mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874502 part 4. Fix private browsing tests to not assume synchronous window closing. r=jdm
This commit is contained in:
parent
2d8e31dcb6
commit
cd3879dd8f
@ -233,7 +233,9 @@ function doTest() {
|
||||
|
||||
privateWin.close();
|
||||
|
||||
testOnWindow(true, function(newPrivateWin) {
|
||||
// The .close() call above will operate asynchronously, so execute the
|
||||
// code below asynchronously as well.
|
||||
function callback(newPrivateWin) {
|
||||
is(newPrivateWin.content.localStorage.getItem("must disappear"), null, "private browsing values threw away");
|
||||
is(newPrivateWin.content.localStorage.length, 0, "No items");
|
||||
|
||||
@ -245,7 +247,8 @@ function doTest() {
|
||||
prefBranch.clearUserPref("browser.startup.page")
|
||||
prefBranch.clearUserPref("browser.startup.homepage_override.mstone");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
};
|
||||
SimpleTest.executeSoon(function() testOnWindow(true, callback));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -99,10 +99,14 @@ function initAndRunTests() {
|
||||
// the data should be on the clipboard inside the private browsing mode
|
||||
is(data2, paste(), "Data successfully copied inside the private browsing mode");
|
||||
aPrivateWindow.close();
|
||||
// the data should no longer be on the clipboard at this stage
|
||||
isnot(data2, paste(), "Data no longer available after leaving the private browsing mode");
|
||||
|
||||
SimpleTest.finish();
|
||||
// The above .close() call will run asynchronously.
|
||||
SimpleTest.executeSoon(function() {
|
||||
// the data should no longer be on the clipboard at this stage
|
||||
isnot(data2, paste(), "Data no longer available after leaving the private browsing mode");
|
||||
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user