зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1321615 fix tests for header modification in toplevel loads, r=kmag
MozReview-Commit-ID: 3GfDbeumwzj --HG-- extra : rebase_source : 6416dd3e5920913682bd0d09e6cfaa08fc6aac63
This commit is contained in:
Родитель
6dc3678ea2
Коммит
9e10dbda93
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче