Bug 1047603 - Fix browser_394759_behaviour.js test. r=ttaubert.

Turns out this test wasn't accustomed to newly created windows having
initially non-remote browsers, and that we need to wait for them to
redirect and restore in the content process before we can properly
serialize the window.

--HG--
extra : rebase_source : 109fe1312a3014ef2036e4ed9cfb4d08b6c4f45e
This commit is contained in:
Mike Conley 2015-01-26 15:21:34 -05:00
parent 3b4d33acec
commit 955064491e

View File

@ -39,11 +39,24 @@ function test() {
let url = "http://example.com/?window=" + windowsToOpen.length;
provideWindow(function onTestURLLoaded(win) {
win.close();
// Give it time to close
executeSoon(function() {
openWindowRec(windowsToOpen, expectedResults, recCallback);
});
let tabReady = () => {
promiseWindowClosed(win).then(() => {
openWindowRec(windowsToOpen, expectedResults, recCallback);
});
};
if (win.gMultiProcessBrowser) {
// For e10s windows, the initial browser starts out non-remote and then
// gets transitioned to remote once a document is requested. The
// history of a browser when transitioned from one remote state to
// another gets restored to the new browser. We need to wait for this
// restoration to occur when we load our test URL, otherwise closed
// window serialization does not work.
let tab = win.gBrowser.selectedTab;
promiseTabRestored(tab).then(tabReady);
} else {
tabReady();
}
}, url, settings);
}