gecko-dev/toolkit/components/url-classifier/tests/mochitest/trackerFrame.html
Dimi Lee 5e81ad2260 Bug 1522412 - P7. A mochitest to test different channel open call sites are classified. r=Ehsan
The goal of this testcase is to provide an easier way to add callsites
to test if it is correctly classified. This is a first step, more callsites should be added to
the testcase(See Bug 1532691)

Flow of the test case:
1. setup the server(trackerFrame.sjs) with the expceted number of request it should receive
2. load the test frame(trackerFrame.html) with cookie restriction off, to ensure all the tracking requests contain cookies
3. server responses a list of tracker's request with cookie after reciving all the requests
4. the list should contain all the trackers in the test frame.
5. enable cookie restriction and load the test frame again.
6. server responses a list of tracker's request without cookie after reciving all the requests
7. the list should contain all the trackers in the test frame.

Differential Revision: https://phabricator.services.mozilla.com/D22116

--HG--
extra : moz-landing-system : lando
2019-03-25 12:51:58 +00:00

72 lines
2.6 KiB
HTML

<!DOCTYPE HTML>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<head>
<title></title>
</head>
<body>
<!--NewImageChannel-->
<img src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=img-src">
<!--nsObjectLoadingContent::OpenChannel-->
<object data="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=object-data"></object>
<!--ScriptLoader::StartLoad-->
<script src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=script-src"></script>
<!--nsDocShell::DoURILoad-->
<iframe src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=iframe-src"></iframe>
<!--Loader::LoadSheet-->
<link rel="stylesheet" href="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=link-rel-stylesheet" />
<!--nsPrefetchNode::OpenChannel-->
<link rel="prefetch" href="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=link-rel-prefetch" />
<!--HTMLMediaElement::ChannelLoader::LoadInternal-->
<video src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=video-src">
</video>
<video src="http://mochi.test:8888/basic.vtt", crossorigin=use-credentials>
<track src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=track-src" ></track>
</video>
<!--SendPing-->
<a ping="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=ping" id="a-ping" href="#"></a>
<script>
(function() {
document.getElementById("a-ping").click();
})();
</script>
<script>
// FetchDriver::HttpFetch
(function() {
try {
fetch(new Request("http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=fetch"), {
credentials: "include",
});
} catch (err) {
console.log(err);
}
})();
// XMLHttpRequestMainThread::CreateChannel
(function() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=xmlhttprequest");
xhr.withCredentials = true;
xhr.send();
})();
// Navigator::SendBeaconInternal
(function() {
navigator.sendBeacon("http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/trackerFrame.sjs?id=send-beacon");
})();
</script>
</body>
</html>