mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
improve browser_354894.js output
--HG-- extra : rebase_source : 0091d4b16fae7732d4dd382f2cfab8c1bc404c43
This commit is contained in:
parent
833ad9da43
commit
65d95048a7
@ -105,7 +105,7 @@
|
||||
* notifications. The latter won't.
|
||||
*/
|
||||
|
||||
function browserWindowsCount() {
|
||||
function browserWindowsCount(expected, msg) {
|
||||
let count = 0;
|
||||
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Ci.nsIWindowMediator)
|
||||
@ -114,11 +114,16 @@ function browserWindowsCount() {
|
||||
if (!e.getNext().closed)
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
is(count, expected, msg + " (nsIWindowMediator)");
|
||||
let state = Cc["@mozilla.org/browser/sessionstore;1"]
|
||||
.getService(Ci.nsISessionStore)
|
||||
.getBrowserState();
|
||||
info(state);
|
||||
is(JSON.parse(state).windows.length, expected, msg + " (getBrowserState)");
|
||||
}
|
||||
|
||||
function test() {
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||
browserWindowsCount(1, "Only one browser window should be open initially");
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
@ -511,34 +516,30 @@ function test() {
|
||||
setupTestsuite();
|
||||
if (navigator.platform.match(/Mac/)) {
|
||||
// Mac tests
|
||||
testMacNotifications(
|
||||
function() testNotificationCount(
|
||||
function() {
|
||||
cleanupTestsuite();
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||
finish();
|
||||
}
|
||||
)
|
||||
);
|
||||
testMacNotifications(function () {
|
||||
testNotificationCount(function () {
|
||||
cleanupTestsuite();
|
||||
browserWindowsCount(1, "Only one browser window should be open eventually");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
// Non-Mac Tests
|
||||
testOpenCloseNormal(
|
||||
function() testOpenClosePrivateBrowsing(
|
||||
function() testOpenCloseWindowAndPopup(
|
||||
function() testOpenCloseOnlyPopup(
|
||||
function() testOpenCloseRestoreFromPopup (
|
||||
function() testNotificationCount(
|
||||
function() {
|
||||
cleanupTestsuite();
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||
finish();
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
testOpenCloseNormal(function () {
|
||||
testOpenClosePrivateBrowsing(function () {
|
||||
testOpenCloseWindowAndPopup(function () {
|
||||
testOpenCloseOnlyPopup(function () {
|
||||
testOpenCloseRestoreFromPopup (function () {
|
||||
testNotificationCount(function () {
|
||||
cleanupTestsuite();
|
||||
browserWindowsCount(1, "Only one browser window should be open eventually");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -166,4 +166,4 @@ function test() {
|
||||
}
|
||||
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user