Backed out changeset 6c26d0bd467b (bug 1141814)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 24 Nov 2016 14:11:52 +0100
changeset 324179 43b2fafc68f489d42956e6ca661066d7480b419f
parent 324178 b92dcbb89ffcf96216a9cfdacfc3b2d652606028
child 324180 91924feee6b0342fe01ea6dbe66cf1e8950c6b3d
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1141814
milestone53.0a1
backs out6c26d0bd467bb05e38055eca393f0efaa252417c
Backed out changeset 6c26d0bd467b (bug 1141814)
toolkit/components/url-classifier/tests/mochitest/chrome.ini
toolkit/components/url-classifier/tests/mochitest/good.js^headers^
toolkit/components/url-classifier/tests/mochitest/mochitest.ini
toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_annotateChannels.html
--- a/toolkit/components/url-classifier/tests/mochitest/chrome.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/chrome.ini
@@ -16,9 +16,8 @@ tags = trackingprotection
 tags = trackingprotection
 [test_trackingprotection_bug1157081.html]
 tags = trackingprotection
 [test_trackingprotection_whitelist.html]
 tags = trackingprotection
 [test_safebrowsing_bug1272239.html]
 [test_donottrack.html]
 [test_classifier_changetablepref.html]
-[test_trackingprotection_annotateChannels.html]
deleted file mode 100644
--- a/toolkit/components/url-classifier/tests/mochitest/good.js^headers^
+++ /dev/null
@@ -1,2 +0,0 @@
-Access-Control-Allow-Origin: *
-Cache-Control: no-store
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
@@ -1,17 +1,16 @@
 [DEFAULT]
 support-files =
   classifiedAnnotatedPBFrame.html
   classifierCommon.js
   classifierFrame.html
   classifierHelper.js
   cleanWorker.js
   good.js
-  good.js^headers^
   evil.css
   evil.css^headers^
   evil.js
   evil.js^headers^
   evilWorker.js
   import.css
   raptor.jpg
   track.html
deleted file mode 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_annotateChannels.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
-  <title>Bug 1141814 - Lower priority of HTTP requests for resources on the Tracking Protection list</title>
-  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                    .getInterface(Ci.nsIWebNavigation)
-                    .QueryInterface(Ci.nsIDocShellTreeItem)
-                    .rootTreeItem
-                    .QueryInterface(Ci.nsIInterfaceRequestor)
-                    .getInterface(Ci.nsIDOMWindow);
-var contentPage = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
-  Services.obs.addObserver(function observer(aSubject, aTopic) {
-    if (aWindow == aSubject) {
-      Services.obs.removeObserver(observer, aTopic);
-      setTimeout(aCallback, 0);
-    }
-  }, "browser-delayed-startup-finished", false);
-}
-
-var defaultPriority = {value:Ci.nsISupportsPriority.PRIORITY_NORMAL};
-var lowestPriority = {value:Ci.nsISupportsPriority.PRIORITY_LOWEST};
-
-var normalPriorityMap = {
-  "evil.js": defaultPriority,
-  "evil.css": defaultPriority,
-  "good.js": defaultPriority,
-};
-
-var lowPriorityMap = {
-  "evil.js": lowestPriority,
-  "evil.css": lowestPriority,
-  "good.js": defaultPriority,
-};
-
-function testChannelPriority(aPrivate ,aCallback, aPriorityMap) {
-  var win = mainWindow.OpenBrowserWindow({private: aPrivate});
-  Services.obs.addObserver(function observer(aSubject, aTopic) {
-    var channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-    var fileName = channel.URI.QueryInterface(Ci.nsIURL).fileName;
-    var priority = channel.QueryInterface(Ci.nsISupportsPriority).priority;
-    if (fileName in aPriorityMap) {
-      is(priority, aPriorityMap[fileName].value, "Channel's priority should be matched.");
-      delete aPriorityMap[fileName];
-    }
-    if (Object.keys(aPriorityMap).length === 0) {
-      Services.obs.removeObserver(observer, aTopic);
-      SimpleTest.executeSoon(function() { aCallback(win); });
-    }
-  }, "http-on-examine-response", false);
-  win.addEventListener("load", function onLoad() {
-    // Update the defaultPriority here base on the document's visibility.
-    defaultPriority.value = document.hasFocus() ? Ci.nsISupportsPriority.PRIORITY_HIGH :
-                                                  Ci.nsISupportsPriority.PRIORITY_NORMAL;
-    win.removeEventListener("load", onLoad, false);
-    whenDelayedStartupFinished(win, function() {
-      win.addEventListener("DOMContentLoaded", function onInnerLoad() {
-        if (win.content.location.href != contentPage) {
-          win.gBrowser.loadURI(contentPage);
-          return;
-        }
-        win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-      }, true);
-      SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
-    });
-  }, true);
-}
-
-SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
-            ["privacy.trackingprotection.enabled", false],
-            ["privacy.trackingprotection.pbmode.enabled", false],
-            ["channelclassifier.allowlist_example", true],
-            ["privacy.trackingprotection.annotate_channels", false]]},
-  test);
-
-function test() {
-  SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
-  UrlClassifierTestUtils.addTestTrackers().then(() => {
-    testChannelPriority(false, function(aWindow) {
-      aWindow.close();
-
-      SpecialPowers.pushPrefEnv(
-        {"set" : [["privacy.trackingprotection.annotate_channels", true]]},
-        function() {
-          testChannelPriority(true, function(aWindow) {
-          aWindow.close();
-          SimpleTest.finish();
-        }, lowPriorityMap);
-      });
-
-    }, normalPriorityMap);
-  });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-</body>
-</html>