Bug 1508817 - Enable ESLint for docshell (manual changes). r=Standard8,bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D23038

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mellina Yonashiro 2019-03-22 07:53:32 +00:00
parent 679a8809c5
commit db352af17e
48 changed files with 137 additions and 110 deletions

View File

@ -14,9 +14,6 @@ obj*/**
# We ignore all these directories by default, until we get them enabled.
# If you are enabling a directory, please add directory specific exclusions
# below.
docshell/test/browser/**
docshell/test/iframesandbox/**
docshell/test/mochitest/**
extensions/cookie/**
extensions/spellcheck/**
extensions/universalchardet/**

View File

@ -6,7 +6,7 @@
const URL = "about:blank";
async function getBrowsingContextId(browser, id) {
return await ContentTask.spawn(
return ContentTask.spawn(
browser,
id,
async function(id) {
@ -29,7 +29,7 @@ async function getBrowsingContextId(browser, id) {
}
async function addFrame(browser, id, parentId) {
return await ContentTask.spawn(
return ContentTask.spawn(
browser,
{parentId, id},
async function({ parentId, id }) {
@ -59,7 +59,7 @@ async function addFrame(browser, id, parentId) {
}
async function removeFrame(browser, id) {
return await ContentTask.spawn(
return ContentTask.spawn(
browser,
id,
async function(id) {

View File

@ -29,6 +29,7 @@ add_task(async function testMultiFrameRestore() {
browser.goBack();
await framesLoaded;
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
await new Promise(r => setTimeout(r, 1000));
await ContentTask.spawn(browser, FRAME_URL, (FRAME_URL) => {
is(content.document.querySelector("#testFrame1").contentWindow.location.href, FRAME_URL);

View File

@ -1,5 +1,5 @@
add_task(async function test() {
const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
const secMan = Services.scriptSecurityManager;
const uris = [undefined, "about:blank"];
function checkContentProcess(newBrowser, uri) {
@ -8,8 +8,7 @@ add_task(async function test() {
Assert.notEqual(prin, null, "Loaded principal must not be null when adding " + uri);
Assert.notEqual(prin, undefined, "Loaded principal must not be undefined when loading " + uri);
const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
const secMan = Services.scriptSecurityManager;
Assert.equal(secMan.isSystemPrincipal(prin), false,
"Loaded principal must not be system when loading " + uri);
});

View File

@ -5,8 +5,7 @@ add_task(async function test() {
Assert.notEqual(prin, null, "Loaded principal must not be null");
Assert.notEqual(prin, undefined, "Loaded principal must not be undefined");
const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
const secMan = Services.scriptSecurityManager;
Assert.equal(secMan.isSystemPrincipal(prin), false,
"Loaded principal must not be system");
});

View File

@ -2,7 +2,7 @@ function test() {
waitForExplicitFinish();
var w;
const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
const secMan = Services.scriptSecurityManager;
var iteration = 1;
const uris = ["", "about:blank"];
var uri;
@ -11,6 +11,7 @@ function test() {
function testLoad() {
if (w.document == origDoc) {
// Go back to polling
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
setTimeout(testLoad, 10);
return;
}
@ -50,6 +51,7 @@ function test() {
origDoc = w.document;
// Need to poll, because load listeners on the content window won't
// survive the load.
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
setTimeout(testLoad, 10);
}
}

View File

@ -31,10 +31,8 @@ function startTest() {
// Load a normal http URL
function testURL(url, func) {
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].
getService(Ci.nsIScriptSecurityManager);
let ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
let secMan = Services.scriptSecurityManager;
let ios = Services.io;
let artificialPrincipal = secMan.createCodebasePrincipal(ios.newURI("http://example.com/"), {});
loadURL("http://example.com/", 0, artificialPrincipal, function() {
let pagePrincipal = browser.contentPrincipal;

View File

@ -3,13 +3,13 @@
"use strict";
var URL = "<!DOCTYPE html><style>" +
var TEST_URL = "<!DOCTYPE html><style>" +
"body {margin:0; padding: 0;} " +
"div {width:100px;height:100px;background:red;} " +
".resize-change-color {width:50px;height:50px;background:blue;} " +
".change-color {width:50px;height:50px;background:yellow;} " +
".add-class {}" +
"</style><div></div>";
URL = "data:text/html;charset=utf8," + encodeURIComponent(URL);
TEST_URL = "data:text/html;charset=utf8," + encodeURIComponent(TEST_URL);
var test = makeTimelineTest("browser_timelineMarkers-frame-02.js", URL);
var test = makeTimelineTest("browser_timelineMarkers-frame-02.js", TEST_URL);

View File

@ -3,13 +3,13 @@
"use strict";
var URL = "<!DOCTYPE html><style>" +
var TEST_URL = "<!DOCTYPE html><style>" +
"body {margin:0; padding: 0;} " +
"div {width:100px;height:100px;background:red;} " +
".resize-change-color {width:50px;height:50px;background:blue;} " +
".change-color {width:50px;height:50px;background:yellow;} " +
".add-class {}" +
"</style><div></div>";
URL = "data:text/html;charset=utf8," + encodeURIComponent(URL);
TEST_URL = "data:text/html;charset=utf8," + encodeURIComponent(TEST_URL);
var test = makeTimelineTest("browser_timelineMarkers-frame-05.js", URL);
var test = makeTimelineTest("browser_timelineMarkers-frame-05.js", TEST_URL);

View File

@ -1,6 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// This file expects frame-head.js to be loaded in the environment.
/* import-globals-from frame-head.js */
"use strict";
// Test that the docShell profile timeline API returns the right markers when
@ -103,7 +106,7 @@ var TESTS = [{
}, {
desc: "Timestamps created by console.timeStamp()",
searchFor: "Timestamp",
setup(docshell) {
setup(docShell) {
content.console.timeStamp("rock");
let markers = docShell.popProfileTimelineMarkers();
is(markers.length, 1, "Got one marker");

View File

@ -1,6 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// This file expects frame-head.js to be loaded in the environment.
/* import-globals-from frame-head.js */
"use strict";
// Test that the docShell profile timeline API returns the right
@ -75,7 +78,7 @@ var TESTS = [{
return markers.filter(m => m.name == "DOMEvent").length >= 2;
},
setup(docShell) {
let doc = content.window.addEventListener("aardvark", function(e) {
content.window.addEventListener("aardvark", function(e) {
console.log("I like ants!");
});

View File

@ -1,6 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// This file expects frame-head.js to be loaded in the environment.
/* import-globals-from frame-head.js */
"use strict";
// Test that the docShell profile timeline API returns the right

View File

@ -1,6 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// This file expects frame-head.js to be loaded in the environment.
/* import-globals-from frame-head.js */
"use strict";
function forceSyncReflow(div) {

View File

@ -1,4 +1,7 @@
// Forward iframe loaded event.
/* eslint-env mozilla/frame-script */
addEventListener("frames-loaded",
e => sendAsyncMessage("test:frames-loaded"), true, true);
@ -8,9 +11,9 @@ let requestObserver = {
// Get DOMWindow on all child docshells to force about:blank
// content viewers being created.
getChildDocShells().map(ds => {
let window = ds.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsILoadContext)
.associatedWindow;
ds.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsILoadContext)
.associatedWindow;
});
}
},

View File

@ -1,3 +1,5 @@
/* eslint-env mozilla/frame-script */
function SHistoryListener() {
}

View File

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/frame-script */
// Functions that are automatically loaded as frame scripts for
// timeline tests.

View File

@ -12,7 +12,7 @@
function do_xhr() {
const theURL = "timelineMarkers-04.html";
xhr = new XMLHttpRequest();
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
dump("ReadyState = " + xhr.readyState + "\n");
};
@ -24,10 +24,10 @@
function do_promise() {
new Promise(function(resolve, reject) {
console.time("Bob");
window.setTimeout(function() {
console.time("Bob");
window.setTimeout(function() {
resolve(23);
}, 10);
}, 10);
}).then(function(val) {
console.timeEnd("Bob");
});
@ -38,9 +38,10 @@
var globalResolver;
function do_promise_script() {
new Promise(function(resolve, reject) {
console.time("Bob");
console.time("Bob");
globalResolver = resolve;
window.setTimeout("globalResolver(23);", 10);
// eslint-disable-next-line no-implied-eval
window.setTimeout("globalResolver(23)", 10);
}).then(function(val) {
console.timeEnd("Bob");
});

View File

@ -13,6 +13,7 @@
}
function setOwnHref() {
// eslint-disable-next-line no-self-assign
location.href = location.href;
}

View File

@ -32,7 +32,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: cross origin child location.replace should NOT be blocked",
script: "window['crossOriginChildIframe'].location.replace(\"" + testDataUri + "\")",

View File

@ -30,7 +30,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: location.replace on auxiliary NOT opened by us should be blocked",
script: "parent.openedWindow.location.replace('file_other_auxiliary_navigation_by_location.html')",
@ -52,7 +52,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
function runNextTest() {
++testCaseIndex;
if (testCaseIndex == testCases.length) {
openedWindow.close();
window.openedWindow.close();
SimpleTest.finish();
return;
}

View File

@ -30,7 +30,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: location.replace on auxiliary opened by us should NOT be blocked",
script: "openedWindow.location.replace('file_our_auxiliary_navigation_by_location.html')",

View File

@ -30,7 +30,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: parent.location.replace should be blocked even when sandboxed with allow-same-origin allow-top-navigation",
script: "parent.location.replace('file_parent_navigation_by_location.html')",

View File

@ -32,7 +32,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: sibling location.replace should be blocked even when sandboxed with allow-same-origin allow-top-navigation",
script: "parent['siblingIframe'].location.replace('file_sibling_navigation_by_location.html')",

View File

@ -31,7 +31,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: top.location.replace should be blocked when sandboxed without allow-top-navigation",
script: "top.location.replace('file_top_navigation_by_location.html')",

View File

@ -32,7 +32,7 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
}
var testCaseIndex = -1;
testCases = [
var testCases = [
{
desc: "Test 1: location.replace.call(top.location, ...) should be blocked when sandboxed without allow-top-navigation",
script: "location.replace.call(top.location, 'file_top_navigation_by_location_exotic.html')",

View File

@ -1 +1 @@
<script>window.onpageshow = function(e) { opener.child1PageShow(e); } </script>
<script>window.onpageshow = function(e) { opener.child1PageShow(e); }; </script>

View File

@ -1 +1 @@
<script>window.onpageshow = function(e) { opener.child2PageShow(e); } </script>
<script>window.onpageshow = function(e) { opener.child2PageShow(e); }; </script>

View File

@ -1,13 +1,22 @@
<html>
<head>
<script>
//<!--
// <!--
function test() {
document.open();
document.write("<html><body onload='opener.documentWriteLoad(); rel();'><a href='foo.html'>foo</a><script>function rel() { setTimeout('location.reload()', 0); }</script></body></html>");
document.write(
`<html>
<body onload='opener.documentWriteLoad(); rel();'>
<a href='foo.html'>foo</a>
<script>
function rel() { setTimeout('location.reload()', 0); }
<\/script>
</body>
</html>`
);
document.close();
}
//-->
// -->
</script>
</head>
<body onload="setTimeout('test()', 0)">

View File

@ -24,7 +24,7 @@
}
// do this with a timeout to see the visuals of the navigations.
setTimeout("nav_frame();", 100);
setTimeout(nav_frame, 100);
}
var step = 1;
@ -76,7 +76,7 @@
break;
}
ok(timing.navigationStart > 0, "navigationStart should be > 0");
sequence = ["navigationStart", "redirectStart", "redirectEnd", "fetchStart"];
var sequence = ["navigationStart", "redirectStart", "redirectEnd", "fetchStart"];
for (var j = 1; j < sequence.length; ++j) {
var prop = sequence[j];
var prevProp = sequence[j - 1];

View File

@ -23,9 +23,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1121701
SimpleTest.executeSoon(function() {
is(e.persisted, false, "Initial page load shouldn't be persisted.");
testWin.document.body.innerHTML = "modified";
testWin.onpagehide = function(e) {
testWin.onpagehide = function(event) {
testWin.onpagehide = null;
ok(e.persisted, "test page 1 should have been persisted");
ok(event.persisted, "test page 1 should have been persisted");
is(testWin.document.body.innerHTML, "modified");
};
testWin.location.href = testUrl2;

View File

@ -22,6 +22,7 @@ function childLoad() {
}
function childLoad2() {
let iframe = document.getElementById("iframe");
let cw = iframe.contentWindow;
let content = cw.document.getElementById("content");

View File

@ -13,7 +13,7 @@
/** Test for Bug 1450164 **/
function runTest() {
child = window.open("file_bug1450164.html", "", "width=100,height=100");
var child = window.open("file_bug1450164.html", "", "width=100,height=100");
child.onload = function() {
// After the window loads, close it. If we don't crash in debug, consider that a pass.
child.close();

View File

@ -26,6 +26,7 @@ SimpleTest.expectAssertions(0, 1); // bug 1333702
var gNumHashchanges = 0;
var gCallbackOnIframeLoad = false;
var gSampleEvent;
function statusMsg(msg) {
var msgElem = document.createElement("p");
@ -169,6 +170,7 @@ function* run_test() {
* the event is targeted at the window object
* the event's cancelable, bubbles settings are correct
*/
enableIframeLoadCallback();
frameCw.document.location = "file_bug385434_2.html";
yield undefined;

View File

@ -18,26 +18,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=387979
/** Test for Bug 387979 **/
function a(s) {
var r;
try { r = frames[0].document.body; } catch (e) { r = e; }
is(r instanceof frames[0].HTMLBodyElement, true,
"Can't get body" + s);
var r;
try { r = frames[0].document.body; } catch (e) { r = e; }
is(r instanceof frames[0].HTMLBodyElement, true, "Can't get body" + s);
}
var p = 0;
function b() {
switch (++p) {
case 1:
frames[0].location = "about:blank";
break;
case 2:
a("before reload");
frames[0].location.reload();
break;
case 3:
a("after reload");
SimpleTest.finish();
break;
}
switch (++p) {
case 1:
frames[0].location = "about:blank";
break;
case 2:
a("before reload");
frames[0].location.reload();
break;
case 3:
a("after reload");
SimpleTest.finish();
break;
}
}
SimpleTest.waitForExplicitFinish();

View File

@ -22,7 +22,7 @@ Test that refresh to data: URIs don't inherit the principal
SimpleTest.waitForExplicitFinish();
gen = runTests();
var gen = runTests();
window.private = 42;

View File

@ -17,7 +17,7 @@ var w = null;
var phase = 0;
var gotWrongPageOnTryAgainClick = false;
function pollForPage(f, w) {
function pollForPage(f, win) {
// Start with polling after a delay, we might mistakenly take the current page
// as an expected one.
window.setTimeout(function() {
@ -27,7 +27,7 @@ function pollForPage(f, w) {
var haveErrorPage = false;
try {
var title = w.document.title;
win.document.title;
} catch (ex) {
haveErrorPage = true;
}
@ -50,15 +50,15 @@ function windowLoaded() {
phase = 1;
pollForPage(function(succeeded) {
ok(succeeded, "Waiting for error page succeeded");
pollForPage(function(enterErrorSucceeded) {
ok(enterErrorSucceeded, "Waiting for error page succeeded");
/* 3. now, while we are on the error page, try to reload it, actually
click the "Try Again" button */
SpecialPowers.wrap(w).location.reload();
pollForPage(function(succeeded) {
ok(succeeded, "Waiting for error page succeeded");
pollForPage(function(continueErrorSucceeded) {
ok(continueErrorSucceeded, "Waiting for error page succeeded");
/* 4-finish, check we are still on the error page */
is(SpecialPowers.wrap(w).location.href, faultyURL, "Is on an error page");

View File

@ -17,7 +17,7 @@ var w = null;
var phase = 0;
var isWindowLoaded = false;
function pollForPage(expectErrorPage, f, w) {
function pollForPage(expectErrorPage, f, win) {
// Start with polling after a delay, we might mistakenly take the current page
// as an expected one.
window.setTimeout(function() {
@ -27,7 +27,7 @@ function pollForPage(expectErrorPage, f, w) {
var haveErrorPage = false;
try {
var title = w.document.title;
win.document.title;
} catch (ex) {
haveErrorPage = true;
}
@ -53,8 +53,8 @@ function windowLoaded() {
w.location.href = faultyURL;
}, 0);
pollForPage(true, function(succeeded) {
ok(succeeded, "Waiting for error page succeeded");
pollForPage(true, function(errorSucceeded) {
ok(errorSucceeded, "Waiting for error page succeeded");
/* 3. now, while we are on the error page, navigate back */
try {
// We need the SpecialPowers bit, because this is a cross-origin window
@ -64,8 +64,8 @@ function windowLoaded() {
ok(false, "w.history.back() threw " + ex);
}
pollForPage(false, function(succeeded) {
ok(succeeded, "Waiting for original page succeeded");
pollForPage(false, function(originalSucceeded) {
ok(originalSucceeded, "Waiting for original page succeeded");
/* 4-finish, check we are back at the original page */
isnot(SpecialPowers.wrap(w).location.href, faultyURL, "Is on an error page");
is(SpecialPowers.wrap(w).location.href, workingURL, "Is not on the previous page");

View File

@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=551225
/** Test for Bug 551225 **/
obj = {
var obj = {
a: new Date("1/1/2000"),
b: /^foo$/,
c: "bar",

View File

@ -17,10 +17,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=570341
function collectMoments() {
var win = frames[0];
var timing = (win.performance && win.performance.timing) || {};
for (var p in timing) {
for (let p in timing) {
moments[p] = timing[p];
}
for (var p in win) {
for (let p in win) {
if (p.substring(0, 9) == "_testing_") {
moments[p.substring(9)] = win[p];
}
@ -40,11 +40,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=570341
sequence.sort(function(a, b) {
return moments[a] - moments[b];
});
table = document.createElement("table");
var table = document.createElement("table");
node.appendChild(table);
row = document.createElement("tr");
var row = document.createElement("tr");
table.appendChild(row);
cell = document.createElement("td");
var cell = document.createElement("td");
row.appendChild(cell);
cell.appendChild(document.createTextNode("start"));
cell = document.createElement("td");

View File

@ -41,9 +41,9 @@ add_task(async function() {
// "are you sure you want to refresh a page with POST data?" dialog. If it
// does, this test will hang and fail, and we'll see 'Refreshing iframe...' at
// the end of the test log.
iframeCw.history.replaceState('', '', '?replaced');
iframeCw.history.replaceState("", "", "?replaced");
info('Refreshing iframe...\n');
info("Refreshing iframe...\n");
iframeCw.location.reload();
let method2 = await new Promise(resolve => {
window.page2Load = resolve;

View File

@ -103,8 +103,6 @@ function dumpSHistory(theWindow) {
dump(" child " + j + ": " + child.URI.spec + "\n");
}
}
return sh;
}
var popup = window.open("file_bug590573_1.html");

View File

@ -73,13 +73,13 @@ function* test() {
SimpleTest.finish();
}
gGen = null;
var gGen = null;
function childLoad() {
gGen = test();
gGen.next();
}
gHashchangeExpected = true;
var gHashchangeExpected = true;
function childHashchange() {
if (gHashchangeExpected) {
gGen.next();
@ -88,7 +88,7 @@ function childHashchange() {
}
}
gCallbackOnPopstate = false;
var gCallbackOnPopstate = false;
function childPopstate() {
if (gCallbackOnPopstate) {
gGen.next();
@ -97,7 +97,7 @@ function childPopstate() {
/* We need to run this test in a popup, because navigating an iframe
* back/forwards tends to cause intermittent orange. */
popup = window.open("file_bug640387.html");
var popup = window.open("file_bug640387.html");
/* Control now flows up to childLoad(), called once the popup loads. */

View File

@ -25,7 +25,7 @@ via a non-history load, we do a true load, rather than a scroll. -->
<script type='application/javascript'>
SimpleTest.waitForExplicitFinish();
callbackOnLoad = false;
var callbackOnLoad = false;
function childLoad() {
if (callbackOnLoad) {
callbackOnLoad = false;
@ -33,8 +33,8 @@ function childLoad() {
}
}
errorOnHashchange = false;
callbackOnHashchange = false;
var errorOnHashchange = false;
var callbackOnHashchange = false;
function childHashchange() {
if (errorOnHashchange) {
ok(false, "Got unexpected hashchange.");
@ -79,7 +79,7 @@ function* run_test() {
}
callbackOnLoad = true;
gGen = run_test();
var gGen = run_test();
</script>

View File

@ -34,7 +34,8 @@ function continueTest() {
function finishTest() {
is(w.document.documentElement.textContent, "opener.finishTest();");
is(w.document.documentElement.innerHTML, "<head><script>opener.finishTest();</" + "script></head>");
is(w.document.documentElement.innerHTML, "<head><script>opener.finishTest();</" +
"script></head>");
w.close();
SimpleTest.finish();
}

View File

@ -48,7 +48,7 @@ var originalTiming = {};
function runTest() {
var timing = $("f").contentWindow.performance.timing;
for (i in timingAttributes) {
for (let i in timingAttributes) {
originalTiming[timingAttributes[i]] = timing[timingAttributes[i]];
}
@ -59,8 +59,8 @@ function runTest() {
SimpleTest.executeSoon(function() {
var newTiming = $("f").contentWindow.performance.timing;
for (var i in timingAttributes) {
is(timing[timingAttributes[i]], originalTiming[timingAttributes[i]],
for (let i in timingAttributes) {
is(newTiming[timingAttributes[i]], originalTiming[timingAttributes[i]],
"document.open should not affect value of " + timingAttributes[i]);
}
SimpleTest.finish();

View File

@ -22,9 +22,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=797909
SimpleTest.waitForExplicitFinish();
function runTest() {
iframe = document.getElementById("ifr");
var iframe = document.getElementById("ifr");
try {
var iframeDoc = iframe.contentWindow.document;
iframe.contentWindow.document;
ok(false, "Should have thrown an exception");
} catch (ex) {
ok(true, "Got an exception");
@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=797909
document.body.appendChild(iframe);
try {
var iframeDoc = iframe.contentWindow.document;
iframe.contentWindow.document;
ok(false, "Should have thrown an exception");
} catch (ex) {
ok(true, "Got an exception");
@ -50,7 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=797909
document.body.appendChild(iframe);
try {
var iframeDoc = iframe.contentWindow.document;
iframe.contentWindow.document;
ok(true, "Shouldn't have thrown an exception");
} catch (ex) {
ok(false, "Got an unexpected exception");

View File

@ -10,8 +10,8 @@ SimpleTest.waitForExplicitFinish();
const w = window.open("file_close_onpagehide1.html");
window.addEventListener("message", e => {
is(e.data, "initial", "The initial page loaded");
window.addEventListener("message", e => {
is(e.data, "second", "The second page loaded");
window.addEventListener("message", evt => {
is(evt.data, "second", "The second page loaded");
w.onpagehide = () => {
w.close();
info("try to close the popped up window in onpagehide");

View File

@ -18,7 +18,7 @@ let testCounter = 0;
function checkFinish() {
testCounter++;
if (testCounter < NUMBER_OF_TESTS) {
return;
return;
}
SimpleTest.finish();
}