Bug 1321615 fix tests for header modification in toplevel loads, r=kmag

MozReview-Commit-ID: DN6LgekAsRm

--HG--
extra : rebase_source : d94aaab49c2df55ea7e5628ad4561bf0743011b1
This commit is contained in:
Shane Caraveo 2016-12-17 10:14:26 -10:00
parent 96e56e12b2
commit 75b4321f38

View File

@ -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