diff --git a/browser/components/extensions/test/browser/browser_ext_webRequest.js b/browser/components/extensions/test/browser/browser_ext_webRequest.js index ab9f58480d9e..5bbe6cdd3988 100644 --- a/browser/components/extensions/test/browser/browser_ext_webRequest.js +++ b/browser/components/extensions/test/browser/browser_ext_webRequest.js @@ -26,6 +26,33 @@ function createHiddenBrowser(url) { 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 @@ -41,6 +68,7 @@ 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 @@ -63,6 +91,7 @@ add_task(function* test_newTab() { let expect = { "file_dummy.html": { type: "main_frame", + headers, }, }; extension.sendMessage("set-expected", {expect, ignore: ["favicon.ico"]}); @@ -77,6 +106,7 @@ add_task(function* test_subframe() { let expect = { "file_dummy.html": { type: "main_frame", + headers, }, }; // test a content subframe attached to hidden window diff --git a/toolkit/components/extensions/test/mochitest/head_webrequest.js b/toolkit/components/extensions/test/mochitest/head_webrequest.js index 636776d0399a..8fb8b9584c82 100644 --- a/toolkit/components/extensions/test/mochitest/head_webrequest.js +++ b/toolkit/components/extensions/test/mochitest/head_webrequest.js @@ -90,6 +90,7 @@ function background(events) { 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];