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 a47f245c15
commit 3b08b542dc
27 changed files with 171 additions and 171 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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