Bug 891806 - part 3 - replace 'yield;' with 'yield undefined;' in docshell/; r=smaug

This commit is contained in:
Tim Taubert 2013-07-10 23:52:26 +02:00
parent a887626424
commit db357b093d
27 changed files with 171 additions and 171 deletions

View File

@ -92,7 +92,7 @@
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.loadURI(test1DocURI);
yield;
yield undefined;
var test2Doc = "data:text/html,<html><head><title>test2</title></head>" +
"<body>test2</body></html>";
@ -102,7 +102,7 @@
{type: "load", title: "test2"},
{type: "pageshow", title: "test2", persisted: false}];
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
// Now go back in history. First page should not have been cached.
// Check persisted property to confirm
@ -110,7 +110,7 @@
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.goBack();
yield;
yield undefined;
}
]]></script>

View File

@ -66,7 +66,7 @@
// Load a page with a no-store header
gBrowser.loadURI(nostoreURI);
yield;
yield undefined;
// Now that the page has loaded, amend the form contents
@ -92,12 +92,12 @@
var simple = "data:text/html,<html><head><title>test2</title></head>" +
"<body>test2</body></html>";
gBrowser.loadURI(simple);
yield;
yield undefined;
// Now go back in history. First page should not have been cached.
gBrowser.goBack();
yield;
yield undefined;
// First uncacheable page will now be reloaded. Check scroll position
@ -115,7 +115,7 @@
// Load a page with a no-cache header
gBrowser.loadURI(nocacheURI);
yield;
yield undefined;
// Now that the page has loaded, amend the form contents
@ -138,12 +138,12 @@
testName + " failed to scroll window vertically");
gBrowser.loadURI(simple);
yield;
yield undefined;
// Now go back in history. First page should not have been cached.
gBrowser.goBack();
yield;
yield undefined;
// First uncacheable page will now be reloaded. Check scroll position
@ -158,7 +158,7 @@
// nextTest has to be called from here, as no events are fired in this
// step
setTimeout(nextTest, 0);
yield;
yield undefined;
}
]]></script>

View File

@ -72,11 +72,11 @@
uri: getHttpUrl("bug293235.html"),
onNavComplete: nextTest
});
yield;
yield undefined;
// Before we go any further, make sure our link has been notified.
waitForTrue(notified, nextTest);
yield;
yield undefined;
// Now that we've been notified, we can check our link color.
// Since we can't use getComputedStyle() for this because
@ -124,12 +124,12 @@
maybeRunNextTest();
}
});
yield;
yield undefined;
// And the nodes get notified after the "link-visited" topic, so
// we need to execute soon...
SimpleTest.executeSoon(nextTest);
yield;
yield undefined;
// Go back, verify the original page was loaded from the bfcache,
// and verify that the link is now purple, per the
@ -142,7 +142,7 @@
title: "Bug 293235 page1" } ],
onNavComplete: nextTest
});
yield;
yield undefined;
// Now we can test the link color.
ok(snapshotsEqual(refVisited, snapshotWindow(TestWindow.getWindow())),
@ -151,7 +151,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -35,7 +35,7 @@
uri: getHttpUrl("bug294258_testcase.html"),
onNavComplete: nextTest
} );
yield;
yield undefined;
// Change the data for each of the form fields, and reload.
$("text").value = "text value";
@ -54,7 +54,7 @@
reload: true,
onNavComplete: nextTest
} );
yield;
yield undefined;
// Verify that none of the form data has changed.
is($("text").value, "text value", "Text value changed");
@ -67,7 +67,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -46,7 +46,7 @@
"<body>find this!</body></html>",
onNavComplete: nextTest
});
yield;
yield undefined;
// Load a second, dummy page, verifying that the original
// page gets stored in the bfcache.
@ -60,11 +60,11 @@
title: "generic page" } ],
onNavComplete: nextTest
});
yield;
yield undefined;
// Make sure we unsuppress painting before continuing
SimpleTest.executeSoon(nextTest);
yield;
yield undefined;
// Search for some text that's on the second page (but not on
// the first page), and verify that it can be found.
@ -74,7 +74,7 @@
gFindBar._findField.value = "A generic page";
gFindBar._find();
SimpleTest.executeSoon(nextTest);
yield;
yield undefined;
// Make sure Find bar's internal status is not 'notfound'
isnot(gFindBar._findField.getAttribute("status"), "notfound",
@ -88,7 +88,7 @@
TestWindow.getWindow().getSelection().toString().toLowerCase() ==
"a generic page");
}, nextTest, 20);
yield;
yield undefined;
is(gFindBar._findField.inputField.value, "A generic page",
"expected text not present in find input field");
@ -106,7 +106,7 @@
persisted: true } ],
onNavComplete: nextTest
});
yield;
yield undefined;
// Search for some text that's on the original page (but not
// the dummy page loaded above), and verify that it can
@ -117,7 +117,7 @@
gFindBar._findField.value = "find this";
gFindBar._find();
SimpleTest.executeSoon(nextTest);
yield;
yield undefined;
// Make sure Find bar's internal status is not 'notfound'
isnot(gFindBar._findField.getAttribute("status"), "notfound",
@ -131,7 +131,7 @@
TestWindow.getWindow().getSelection().toString().toLowerCase() ==
"find this");
}, nextTest, 20);
yield;
yield undefined;
is(TestWindow.getWindow().getSelection().toString().toLowerCase(),
"find this",
@ -140,7 +140,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -59,7 +59,7 @@
uri: getHttpUrl("generic.html"),
onNavComplete: nextTest
});
yield;
yield undefined;
// Load a page containing an iframe.
doPageNavigation({
@ -76,7 +76,7 @@
persisted: false } ], // false on initial load
onNavComplete: nextTest
});
yield;
yield undefined;
// Click a link in the iframe to cause the iframe to navigate
// to a new page, and wait until the related pagehide/pageshow
@ -98,7 +98,7 @@
false, false, false, false,
0, null);
link.dispatchEvent(event);
yield;
yield undefined;
// Load another dummy page. Verify that both the outgoing parent and
// iframe pages are stored in the bfcache.
@ -116,7 +116,7 @@
persisted: false } ], // false on initial load
onNavComplete: nextTest
});
yield;
yield undefined;
// Go back. The iframe should show the second page loaded in it.
// Both the parent and the iframe pages should be loaded from
@ -135,7 +135,7 @@
title: "iframe parent" } ],
onNavComplete: nextTest
});
yield;
yield undefined;
verifyIframeInnerHtml("You made it");
@ -153,7 +153,7 @@
persisted: false } ],
onNavComplete: nextTest
});
yield;
yield undefined;
verifyIframeInnerHtml("go to next page");
@ -174,7 +174,7 @@
persisted: true } ],
onNavComplete: nextTest
});
yield;
yield undefined;
doPageNavigation({
forward: true,
@ -187,7 +187,7 @@
persisted: true} ],
onNavComplete: nextTest
});
yield;
yield undefined;
verifyIframeInnerHtml("go to next page");
@ -204,7 +204,7 @@
persisted: false } ],
onNavComplete: nextTest
});
yield;
yield undefined;
verifyIframeInnerHtml("You made it");
@ -222,7 +222,7 @@
persisted: true } ],
onNavComplete: nextTest
});
yield;
yield undefined;
// Go back once more, and again verify that the iframe shows the
// second page loaded in it.
@ -240,14 +240,14 @@
title: "iframe parent" } ],
onNavComplete: nextTest
});
yield;
yield undefined;
verifyIframeInnerHtml("You made it");
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -37,7 +37,7 @@
onNavComplete: nextTest
};
doPageNavigation(navData);
yield;
yield undefined;
// Save the HTML of the test page for later comparison.
var originalHTML = getInnerHTMLById("div1");
@ -57,7 +57,7 @@
onNavComplete: nextTest
};
doPageNavigation(navData);
yield;
yield undefined;
// Go back. Verify that the pageshow event for the original test page
// had a .persisted property of true, indicating that it came from the
@ -73,7 +73,7 @@
onNavComplete: nextTest
};
doPageNavigation(navData);
yield;
yield undefined;
// After going back, if showpagecount() could access a global variable
// and change the test div's innerHTML, then we pass. Otherwise, it
@ -85,7 +85,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
////

View File

@ -70,7 +70,7 @@
title: "bug321671 page" + (i + 1) } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
is(TestWindow.getWindow().scrollY, 0,
"Page initially has non-zero scrollY position");
@ -98,7 +98,7 @@
persisted: i > 1 } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
is(TestWindow.getWindow().scrollY, scrollPositions[i-1],
"Scroll position not restored while going back!");
@ -121,7 +121,7 @@
title: "bug321671 page" + (i + 1) } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
is(TestWindow.getWindow().scrollY, scrollPositions[i],
"Scroll position not restored while going forward!");
@ -130,7 +130,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -41,7 +41,7 @@
onNavComplete: nextTest,
preventBFCache: i != 1
} );
yield;
yield undefined;
// Store the original url for later comparison.
var originalUrl = TestWindow.getBrowser().currentURI.spec;
@ -59,7 +59,7 @@
false, false, false, false, 0, null);
TestWindow.getDocument().getElementById("link1").dispatchEvent(event);
setTimeout(nextTest, 0);
yield;
yield undefined;
// Store the fragment url for later comparison.
var fragmentUrl = TestWindow.getBrowser().currentURI.spec;
@ -79,7 +79,7 @@
{type: "pageshow"} ],
onNavComplete: nextTest
} );
yield;
yield undefined;
// Go back
doPageNavigation( {
@ -89,7 +89,7 @@
persisted: i == 1} ],
onNavComplete: nextTest
} );
yield;
yield undefined;
// Verify the current url is the fragment url
is(TestWindow.getBrowser().currentURI.spec, fragmentUrl,
@ -113,7 +113,7 @@
function() {
setTimeout(nextTest, 0);
}, 20);
yield;
yield undefined;
// Verify the current url is the original url without fragment
is(TestWindow.getBrowser().currentURI.spec, originalUrl,
@ -125,7 +125,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -92,7 +92,7 @@
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.loadURI(test1Doc);
yield;
yield undefined;
var test2Doc = "data:text/html,<html><head><title>test2</title></head>" +
"<body>test2</body></html>";
@ -101,17 +101,17 @@
{type: "load", title: "test2"},
{type: "pageshow", title: "test2", persisted: false}];
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test2", persisted: true},
{type: "pageshow", title: "test1", persisted: true}];
gBrowser.goBack();
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test1", persisted: true},
{type: "pageshow", title: "test2", persisted: true}];
gBrowser.goForward();
yield;
yield undefined;
// Tests 3 + 4:
// Back/forward between a two-level deep iframed document and a simple
@ -139,7 +139,7 @@
{type: "load", title: "test3"},
{type: "pageshow", title: "test3", persisted: false}];
gBrowser.loadURI(test3Doc);
yield;
yield undefined;
var test4Doc = "data:text/html,<html><head><title>test4</title></head>" +
"<body>test4</body></html>";
@ -150,14 +150,14 @@
{type: "load", title: "test4"},
{type: "pageshow", title: "test4", persisted: false}];
gBrowser.loadURI(test4Doc);
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test4", persisted: true},
{type: "pageshow", title: "test3-nested2", persisted: true},
{type: "pageshow", title: "test3-nested1", persisted: true},
{type: "pageshow", title: "test3", persisted: true}];
gBrowser.goBack();
yield;
yield undefined;
// This is where the two nested pagehide are not dispatched in bug 364461
gExpected = [{type: "pagehide", title: "test3", persisted: true},
@ -165,7 +165,7 @@
{type: "pagehide", title: "test3-nested2", persisted: true},
{type: "pageshow", title: "test4", persisted: true}];
gBrowser.goForward();
yield;
yield undefined;
// Tests 5 + 6:
// Back/forward between a document containing an unload handler and a
@ -180,7 +180,7 @@
{type: "load", title: "test5"},
{type: "pageshow", title: "test5", persisted: false}];
gBrowser.loadURI(test5Doc);
yield;
yield undefined;
var test6Doc = "data:text/html,<html><head><title>test6</title></head>" +
"<body>test6</body></html>";
@ -190,19 +190,19 @@
{type: "load", title: "test6"},
{type: "pageshow", title: "test6", persisted: false}];
gBrowser.loadURI(test6Doc);
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test6", persisted: true},
{type: "load", title: "test5"},
{type: "pageshow", title: "test5", persisted: false}];
gBrowser.goBack();
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test5", persisted: false},
{type: "unload", title: "test5"},
{type: "pageshow", title: "test6", persisted: true}];
gBrowser.goForward();
yield;
yield undefined;
// Test 7:
// Testcase from https://bugzilla.mozilla.org/show_bug.cgi?id=384977#c10
@ -226,7 +226,7 @@
{type: "load", title: "test7"},
{type: "pageshow", title: "test7", persisted: false}];
gBrowser.loadURI(test7Doc);
yield;
yield undefined;
// Simulates a click on the link inside the iframe
function clickIframeLink() {
@ -245,7 +245,7 @@
{type: "load"},
{type: "pageshow", persisted: false}];
clickIframeLink();
yield;
yield undefined;
is(gBrowser.currentURI.spec, "data:text/plain,aaa",
"Navigation is blocked when clicking link");
@ -254,14 +254,14 @@
{type: "pageshow", title: "test7-nested1", persisted: true},
{type: "pageshow", title: "test7", persisted: true}];
gBrowser.goBack();
yield;
yield undefined;
gExpected = [{type: "pagehide", title: "test7", persisted: true},
{type: "pagehide", title: "test7-nested1", persisted: true},
{type: "load"},
{type: "pageshow", persisted: false}];
clickIframeLink();
yield;
yield undefined;
is(gBrowser.currentURI.spec, "data:text/plain,aaa",
"Navigation is blocked when clicking link");
@ -269,7 +269,7 @@
// nextTest has to be called from here, as no events are fired in this
// step
setTimeout(nextTest, 0);
yield;
yield undefined;
}
]]></script>

View File

@ -110,58 +110,58 @@
gTestCount++;
gExpected = [false];
gBrowser.loadURI(test1Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [true, false];
var test2Doc = test1Doc.replace(/1/,"2");
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [true, true, false];
gBrowser.loadURI(test1Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [true, true, true, false];
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [false, true, true, true, false];
gBrowser.loadURI(test1Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [false, false, true, true, true, false];
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
gTestCount++;
gExpected = [false, false, true, true, false, true];
gBrowser.goBack();
yield;
yield undefined;
gTestCount++;
gExpected = [false, false, true, true, true, false];
gBrowser.goForward();
yield;
yield undefined;
gTestCount++;
gExpected = [false, false, true, true, true, false];
gBrowser.gotoIndex(1);
yield;
yield undefined;
gTestCount++;
gExpected = [false, true, true, true, false, false];
gBrowser.goBack();
yield;
yield undefined;
gTestCount++;
gExpected = [false, false, true, true, false, false];
gBrowser.gotoIndex(5);
yield;
yield undefined;
}
]]></script>

View File

@ -67,7 +67,7 @@
title: "bug396649 page" + i } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
}
// Go back to the first page, one page at a time. The first
@ -87,7 +87,7 @@
persisted: i > 1 } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
}
// Traverse history forward now. Again, the first MAX_BFCACHE_PAGES
@ -107,13 +107,13 @@
persisted: i < MAX_BFCACHE_PAGES + 1 } ],
onNavComplete: nextTest
} );
yield;
yield undefined;
}
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -43,26 +43,26 @@
var modifiedDOM = getDOM("f1");
isnot(origDOM, modifiedDOM, "DOM should be different");
$("f1").contentWindow.location.href = doc2;
yield;
yield undefined;
$("f1").goBack();
yield;
yield undefined;
is(getDOM("f1"), modifiedDOM, "Should have been bfcached");
$("f1").goForward();
yield;
yield undefined;
// Ignore the notifications during swap
$("f1").removeEventListener("pageshow", testDriver, false);
$("f1").swapDocShells($("f2"));
$("f2").addEventListener("pageshow", testDriver, false);
$("f2").goBack();
yield;
yield undefined;
is(getDOM("f2"), origDOM, "Should have not have been bfcached");
window.close();
SimpleTest.finish();
yield;
yield undefined;
})();
function testDriver() {

View File

@ -57,26 +57,26 @@
os.addObserver(observer, "content-document-global-created", false);
browser.loadURI("http://mochi.test:8888/tests/docshell/test/chrome/582176_dummy.html");
yield;
yield undefined;
is(browser.contentWindow.testVar, undefined,
"variable unexpectedly there already");
browser.contentWindow.wrappedJSObject.testVar = 1;
is(notificationCount, 1, "Should notify on first navigation");
browser.loadURI("http://mochi.test:8888/tests/docshell/test/chrome/582176_dummy.html?2");
yield;
yield undefined;
is(browser.contentWindow.wrappedJSObject.testVar, undefined,
"variable should no longer be there");
is(notificationCount, 2, "Should notify on second navigation");
browser.goBack();
yield;
yield undefined;
is(browser.contentWindow.wrappedJSObject.testVar, 1,
"variable should still be there");
is(notificationCount, 2, "Should not notify on back navigation");
browser.loadURI("http://mochi.test:8888/tests/docshell/test/chrome/582176_xml.xml");
yield;
yield undefined;
is(browser.contentDocument.body.textContent, "xslt result",
"Transform performed successfully");
is(notificationCount, 3, "Should notify only once on XSLT navigation");
@ -86,7 +86,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -38,7 +38,7 @@
onNavComplete: nextTest
};
doPageNavigation(navData);
yield;
yield undefined;
// Load the second test page.
navData = {
@ -55,7 +55,7 @@
event.initMouseEvent("click", true, true, TestWindow.getWindow(),
0, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
yield;
yield undefined;
// Load the third test page.
navData = {
@ -72,7 +72,7 @@
event.initMouseEvent("click", true, true, TestWindow.getWindow(),
0, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
yield;
yield undefined;
// Go back.
navData = {
@ -85,7 +85,7 @@
onNavComplete: nextTest
};
doPageNavigation(navData);
yield;
yield undefined;
var Ci = Components.interfaces;
var docshell = TestWindow.getWindow()
@ -110,7 +110,7 @@
// so we call reload explicitly here
waitForPageEvents(navData);
shistory.reload(0);
yield;
yield undefined;
// After this sequence of events, we should be able to go back and forward
is(TestWindow.getBrowser().canGoBack, true, "Should be able to go back!");
@ -120,7 +120,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -27,7 +27,7 @@
uri: 'data:text/html,<title>initial load</title>',
onNavComplete: nextTest
});
yield;
yield undefined;
// Now load a new page
doPageNavigation({
@ -47,7 +47,7 @@
],
onNavComplete: nextTest
});
yield;
yield undefined;
// Now go back
doPageNavigation({
@ -70,7 +70,7 @@
],
onNavComplete: nextTest
});
yield;
yield undefined;
// And forward
doPageNavigation({
@ -93,7 +93,7 @@
],
onNavComplete: nextTest
});
yield;
yield undefined;
function generateDetector(state, hidden, title, name) {
var detector = function (event) {
@ -118,7 +118,7 @@
// Now flip our docshell to not active
document.getElementById("content").docShellIsActive = false;
yield;
yield undefined;
// And navigate back; there should be no visibility state transitions
doPageNavigation({
@ -134,13 +134,13 @@
unexpectedEvents: [ "visibilitychange" ],
onNavComplete: nextTest
});
yield;
yield undefined;
generateDetector("visible", false, "initial load", "Going visible");
// Now set the docshell active again
document.getElementById("content").docShellIsActive = true;
yield;
yield undefined;
// And forward
doPageNavigation({
@ -163,12 +163,12 @@
],
onNavComplete: nextTest
});
yield;
yield undefined;
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -44,7 +44,7 @@
onNavComplete: nextTest,
preventBFCache: true
});
yield;
yield undefined;
var first = snapshotWindow(TestWindow.getWindow());
@ -52,7 +52,7 @@
uri: "about:blank",
onNavComplete: nextTest
});
yield;
yield undefined;
var second = snapshotWindow(TestWindow.getWindow());
function snapshotsEqual(snap1, snap2) {
@ -64,7 +64,7 @@
back: true,
onNavComplete: nextTest
});
yield;
yield undefined;
var third = snapshotWindow(TestWindow.getWindow());
ok(!snapshotsEqual(third, second), "going back should not be the same as about:blank");
@ -73,7 +73,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -92,7 +92,7 @@
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.loadURI(test1DocURI);
yield;
yield undefined;
var test2Doc = "data:text/html,<html><head><title>test2</title></head>" +
"<body>test2</body></html>";
@ -102,7 +102,7 @@
{type: "load", title: "test2"},
{type: "pageshow", title: "test2", persisted: false}];
gBrowser.loadURI(test2Doc);
yield;
yield undefined;
// Now go back in history. First page should not have been cached.
// Check persisted property to confirm
@ -110,7 +110,7 @@
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.goBack();
yield;
yield undefined;
}
]]></script>

View File

@ -84,14 +84,14 @@ function doTest() {
// Try loading in an iframe
iframe.setAttribute("src", "bug608669.xul");
iframe.onload = nextTest;
yield;
yield undefined;
is(notificationCount, 1, "after first load");
is(iframe.contentWindow.x, "y", "reused window");
// Try loading again in an iframe
iframe.setAttribute("src", "bug608669.xul?x");
iframe.onload = nextTest;
yield;
yield undefined;
is(notificationCount, 2, "after second load");
is("x" in iframe.contentWindow, false, "didn't reuse window");
@ -99,7 +99,7 @@ function doTest() {
popup = window.open("bug608669.xul", "bug 608669",
"chrome,width=600,height=600");
popup.onload = nextTest;
yield;
yield undefined;
is(notificationCount, 3, "after window.open load");
popup.close();
@ -107,7 +107,7 @@ function doTest() {
os.removeObserver(observer, "chrome-document-global-created");
os.removeObserver(observer, "content-document-global-created");
SimpleTest.finish();
yield;
yield undefined;
}

View File

@ -35,7 +35,7 @@
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.
finish();
yield;
yield undefined;
}
]]></script>

View File

@ -91,24 +91,24 @@ function test() {
'Popup 1' +
'</body></html>');
waitForLoad(1);
yield;
yield undefined;
popup.history.pushState('', '', '');
popup.location = 'data:text/html,<html><body onload="opener.childLoad(2)">Popup 2</body></html>';
waitForLoad(2);
yield;
yield undefined;
// Now go back 2. The first page should be retrieved from bfcache.
popup.history.go(-2);
waitForShow(1);
yield;
yield undefined;
popup.close();
SimpleTest.finish();
// Yield once more so we don't throw a StopIteration exception.
yield;
yield undefined;
}
var gGen = test();

View File

@ -108,36 +108,36 @@ function run_test() {
enableIframeLoadCallback();
frameCw.document.location = "file_bug385434_1.html";
// Wait for the iframe to load and for our callback to fire
yield;
yield undefined;
noEventExpected("No hashchange expected initially.");
sendMouseEvent({type: "click"}, "link1", frameCw);
yield;
yield undefined;
eventExpected("Clicking link1 should trigger a hashchange.");
sendMouseEvent({type: "click"}, "link1", frameCw);
longWait();
yield;
yield undefined;
// succeed if a hashchange event wasn't triggered while we were waiting
noEventExpected("Clicking link1 again should not trigger a hashchange.");
sendMouseEvent({type: "click"}, "link2", frameCw);
yield;
yield undefined;
eventExpected("Clicking link2 should trigger a hashchange.");
frameCw.history.go(-1);
yield;
yield undefined;
eventExpected("Going back should trigger a hashchange.");
frameCw.history.go(1);
yield;
yield undefined;
eventExpected("Going forward should trigger a hashchange.");
// window.location has a trailing '#' right now, so we append "link1", not
// "#link1".
frameCw.window.location = frameCw.window.location + "link1";
yield;
yield undefined;
eventExpected("Assigning to window.location should trigger a hashchange.");
// Set up history in the iframe which looks like:
@ -146,18 +146,18 @@ function run_test() {
// file_bug385434_1.html#foo <-- current page
enableIframeLoadCallback();
frameCw.window.location = "file_bug385434_2.html";
yield;
yield undefined;
enableIframeLoadCallback();
frameCw.window.location = "file_bug385434_1.html#foo";
yield;
yield undefined;
// Now when we do history.go(-2) on the frame, it *shouldn't* fire a
// hashchange. Although the URIs differ only by their hashes, they belong to
// two different Documents.
frameCw.history.go(-2);
longWait();
yield;
yield undefined;
noEventExpected("Moving between different Documents shouldn't " +
"trigger a hashchange.");
@ -169,10 +169,10 @@ function run_test() {
*/
enableIframeLoadCallback();
frameCw.document.location = "file_bug385434_2.html";
yield;
yield undefined;
frameCw.document.location = "file_bug385434_2.html#foo";
yield;
yield undefined;
eventExpected("frame onhashchange should fire events.");
// iframe should set gSampleEvent
@ -191,12 +191,12 @@ function run_test() {
* not "complete" (bug 504837).
*/
frameCw.document.location = "file_bug385434_3.html";
yield;
yield undefined;
eventExpected("Hashchange should fire even if the document " +
"hasn't finished loading.");
SimpleTest.finish();
yield;
yield undefined;
}
var gGen = run_test();

View File

@ -39,7 +39,7 @@ function runTests() {
let res = (yield);
if (res == "done") {
SimpleTest.finish();
yield;
yield undefined;
}
is(res, "pass");
}

View File

@ -47,28 +47,28 @@ function runTest() {
popup.hashchangeCallback = onChildHashchange;
popup.onload = onChildLoad;
dump('Waiting for initial load.\n');
yield;
yield undefined;
// Without this wait, the change to location.hash below doesn't create a
// SHEntry or enable the back button.
shortWait();
dump('Got initial load. Spinning event loop.\n');
yield;
yield undefined;
popup.location.hash = "#1";
dump('Waiting for hashchange.\n');
yield;
yield undefined;
popup.history.back();
dump('Waiting for second hashchange.\n');
yield; // wait for hashchange
yield undefined; // wait for hashchange
popup.document.title = "Changed";
// Wait for listeners to be notified of the title change.
shortWait();
dump('Got second hashchange. Spinning event loop.\n');
yield;
yield undefined;
var sh = SpecialPowers.wrap(popup)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
@ -83,7 +83,7 @@ function runTest() {
SimpleTest.executeSoon(SimpleTest.finish);
dump('Final yield.\n');
yield;
yield undefined;
}
window.addEventListener('load', function() {

View File

@ -18,7 +18,7 @@ SimpleTest.waitForExplicitFinish();
function test() {
/* Spin the event loop so we get out of the onload handler. */
SimpleTest.executeSoon(function() { gGen.next() });
yield;
yield undefined;
popup.history.pushState('', '', '#hash1');
popup.history.pushState('', '', '#hash2');
@ -31,12 +31,12 @@ function test() {
// Going back should trigger a hashchange, which will wake us up from the
// yield.
popup.history.back();
yield;
yield undefined;
ok(true, 'Got first hashchange.');
// Going back should wake us up again.
popup.history.back();
yield;
yield undefined;
ok(true, 'Got second hashchange.');
// Now the history looks like:
@ -46,7 +46,7 @@ function test() {
// Going forward should trigger a hashchange.
popup.history.forward();
yield;
yield undefined;
ok(true, 'Got third hashchange.');
// Now modify the history so it looks like:
@ -61,17 +61,17 @@ function test() {
gHashchangeExpected = false;
gCallbackOnPopstate = true;
SimpleTest.executeSoon(function() { popup.history.back() });
yield;
yield undefined;
ok(true, 'Got popstate.');
gCallbackOnPopstate = false;
// Spin the event loop so hashchange has a chance to fire, if it's going to.
SimpleTest.executeSoon(function() { gGen.next() });
yield;
yield undefined;
popup.close();
SimpleTest.finish();
yield;
yield undefined;
}
gGen = null;

View File

@ -52,13 +52,13 @@ function run_test() {
// Spin the event loop so we exit the onload handler.
SimpleTest.executeSoon(function() { gGen.next() });
yield;
yield undefined;
let origLocation = iframe.location + '';
callbackOnHashchange = true;
iframe.location.hash = '#1';
// Wait for a hashchange event.
yield;
yield undefined;
ok(true, 'Got hashchange.');
@ -67,16 +67,16 @@ function run_test() {
// result of the load is a different document than we had previously.
callbackOnLoad = true;
errorOnHashchange = true;
yield;
yield undefined;
ok(true, 'Got final load.');
// Spin the event loop to give hashchange a chance to fire, if it's going to.
SimpleTest.executeSoon(function() { gGen.next() });
yield;
yield undefined;
SimpleTest.finish();
yield;
yield undefined;
}
callbackOnLoad = true;

View File

@ -72,7 +72,7 @@ function test()
// Step 2 - We'll get another onChildLoad when this finishes.
popup.location = 'file_bug669671.sjs';
yield;
yield undefined;
// Step 3 - Call pushState and change the URI back to ?pushed.
checkPopupLoadCount();
@ -80,13 +80,13 @@ function test()
// Step 4 - Navigate away. This should trigger another onChildLoad.
popup.location = 'file_bug669671.sjs?navigated-1';
yield;
yield undefined;
// Step 5 - Go back. This should result in another onload (because the file is
// not in bfcache) and should be the fourth time we've requested the sjs file.
checkPopupLoadCount();
popup.back();
yield;
yield undefined;
// This is the check which was failing before we fixed the bug.
checkPopupLoadCount();
@ -95,37 +95,37 @@ function test()
// Do the whole thing again, but with replaceState.
popup = window.open('file_bug669671.sjs?replaced');
yield;
yield undefined;
checkPopupLoadCount();
popup.location = 'file_bug669671.sjs';
yield;
yield undefined;
checkPopupLoadCount();
popup.history.replaceState('', '', '?replaced');
popup.location = 'file_bug669671.sjs?navigated-2';
yield;
yield undefined;
checkPopupLoadCount();
popup.back();
yield;
yield undefined;
checkPopupLoadCount();
popup.close();
// Once more, with feeling. Notice that we don't have to prime the cache
// with an extra load here, because X and X#hash share the same cache entry.
popup = window.open('file_bug669671.sjs?hash-test');
yield;
yield undefined;
var initialCount = checkPopupLoadCount();
popup.history.replaceState('', '', '#hash');
popup.location = 'file_bug669671.sjs?navigated-3';
yield;
yield undefined;
checkPopupLoadCount();
popup.back();
yield;
yield undefined;
is(popup.document.body.innerHTML, initialCount + '',
'Load count (should be cached)');
popup.close();
SimpleTest.finish();
yield;
yield undefined;
}
// This will call into onChildLoad once it loads.