Bug 1298823 - Fix Request constructor - with "mode: navigate"

This commit is contained in:
janekptacijarabaci 2018-07-05 13:08:32 +02:00 • committed by Roy Tam
commit 56c088c2d4
3 changed files with 17 additions and 33 deletions

View file

@ -152,12 +152,9 @@ function testHeaderGuard() {
}
function testMode() {
try {
var req = new Request("http://example.com", {mode: "navigate"});
ok(false, "Creating a Request with navigate RequestMode should throw a TypeError");
} catch(e) {
is(e.name, "TypeError", "Creating a Request with navigate RequestMode should throw a TypeError");
}
var req = new Request("http://example.com", {mode: "navigate"});
ok(true, "Creating a Request with navigate RequestMode should not throw.");
is(req.mode, "same-origin", "Request mode becomes same-origin");
}
function testMethod() {