Backed out changeset 4c343bdb6e2a (bug 1321615) for browser_ext_webRequest.js timeouts
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 01 Dec 2016 18:38:11 -0800
changeset 325063 cf2d377f4a5fc4f7b2402406908abd0ca571e3f8
parent 325062 c4db9e919f6c7b4cb6b3892a3a23f3056d63f811
child 325064 b1e2d1fe6b070b71661047f94129a1ccd0a7f48f
child 325096 76bbb68f8441b2067e45a75baaac6d7c6a00400b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1321615
milestone53.0a1
backs out4c343bdb6e2aad0f2254bfa14d39b19810a53201
Backed out changeset 4c343bdb6e2a (bug 1321615) for browser_ext_webRequest.js timeouts CLOSED TREE
browser/components/extensions/test/browser/browser_ext_webRequest.js
toolkit/components/extensions/test/mochitest/head_webrequest.js
--- a/browser/components/extensions/test/browser/browser_ext_webRequest.js
+++ b/browser/components/extensions/test/browser/browser_ext_webRequest.js
@@ -21,59 +21,31 @@ function createHiddenBrowser(url) {
 
       doc.documentElement.appendChild(browser);
       resolve({frame: frame, browser: browser});
     }));
 }
 
 let extension;
 let dummy = "http://mochi.test:8888/browser/browser/components/extensions/test/browser/file_dummy.html";
-let headers = {
-  request: {
-    add: {
-      "X-WebRequest-request": "text",
-      "X-WebRequest-request-binary": "binary",
-    },
-    modify: {
-      "user-agent": "WebRequest",
-    },
-    remove: [
-      "accept-encoding",
-    ],
-  },
-  response: {
-    add: {
-      "X-WebRequest-response": "text",
-      "X-WebRequest-response-binary": "binary",
-    },
-    modify: {
-      "server": "WebRequest",
-      "content-type": "text/html; charset=utf-8",
-    },
-    remove: [
-      "connection",
-    ],
-  },
-};
 
 add_task(function* setup() {
   // SelfSupport has a tendency to fire when running this test alone, without
   // a good way to turn it off we just set the url to ""
   yield SpecialPowers.pushPrefEnv({
     set: [["browser.selfsupport.url", ""]],
   });
   extension = makeExtension();
   yield extension.startup();
 });
 
 add_task(function* test_newWindow() {
   let expect = {
     "file_dummy.html": {
       type: "main_frame",
-      headers,
     },
   };
   // NOTE: When running solo, favicon will be loaded at some point during
   // the tests in this file, so all tests ignore it.  When running with
   // other tests in this directory, favicon gets loaded at some point before
   // we run, and we never see the request, thus it cannot be handled as part
   // of expect above.
   extension.sendMessage("set-expected", {expect, ignore: ["favicon.ico"]});
@@ -86,32 +58,30 @@ add_task(function* test_newWindow() {
   yield BrowserTestUtils.closeWindow(openedWindow);
 });
 
 add_task(function* test_newTab() {
   // again, in this window
   let expect = {
     "file_dummy.html": {
       type: "main_frame",
-      headers,
     },
   };
   extension.sendMessage("set-expected", {expect, ignore: ["favicon.ico"]});
   yield extension.awaitMessage("continue");
   let tab = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser, dummy + "?newTab");
 
   yield extension.awaitMessage("done");
   yield BrowserTestUtils.removeTab(tab);
 });
 
 add_task(function* test_subframe() {
   let expect = {
     "file_dummy.html": {
       type: "main_frame",
-      headers,
     },
   };
   // test a content subframe attached to hidden window
   extension.sendMessage("set-expected", {expect, ignore: ["favicon.ico"]});
   yield extension.awaitMessage("continue");
   let frameInfo = yield createHiddenBrowser(dummy + "?subframe");
   yield extension.awaitMessage("done");
   // cleanup
--- a/toolkit/components/extensions/test/mochitest/head_webrequest.js
+++ b/toolkit/components/extensions/test/mochitest/head_webrequest.js
@@ -85,17 +85,16 @@ function background(events) {
   //   remove: ["HeaderName",],
   // },
   function processHeaders(phase, expected, details) {
     // This should only happen once per phase [request|response].
     browser.test.assertFalse(!!expected.test[phase], `First processing of headers for ${phase}`);
     expected.test[phase] = true;
 
     let headers = details[`${phase}Headers`];
-    browser.test.log(`headers are ${JSON.stringify(headers)}`);
     browser.test.assertTrue(Array.isArray(headers), `${phase}Headers array present`);
 
     let {add, modify, remove} = expected.headers[phase];
 
     for (let name in add) {
       browser.test.assertTrue(!headers.find(h => h.name === name), `header ${name} to be added not present yet in ${phase}Headers`);
       let header = {name: name};
       if (name.endsWith("-binary")) {