зеркало из https://github.com/mozilla/gecko-dev.git
Fix intermittent failures in test_cocoa_focus.html. r=jst a=tests
This commit is contained in:
Родитель
aa0bfea616
Коммит
8dc60ed6f0
|
@ -14,6 +14,10 @@
|
|||
window.opener.SimpleTest.ok(aValue, aMessage);
|
||||
}
|
||||
|
||||
function executeSoon(func) {
|
||||
window.opener.SimpleTest.executeSoon(func);
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
var plugin1 = document.getElementById("plugin1");
|
||||
var plugin2 = document.getElementById("plugin2");
|
||||
|
@ -52,17 +56,11 @@
|
|||
window.opener.addEventListener("focus", function() {
|
||||
window.opener.removeEventListener("focus", arguments.callee, false);
|
||||
|
||||
expectedEventCount++;
|
||||
|
||||
is(plugin1.getTopLevelWindowActivationState(), false, "Activation state should be: deactivated");
|
||||
is(plugin1.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount);
|
||||
|
||||
is(plugin2.getTopLevelWindowActivationState(), false, "Activation state should be: deactivated");
|
||||
is(plugin2.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount);
|
||||
|
||||
// Bring our window back to the front and make sure plugins were properly notified.
|
||||
window.focus();
|
||||
executeSoon(function() {
|
||||
window.addEventListener("focus", function() {
|
||||
window.removeEventListener("focus", arguments.callee, false);
|
||||
|
||||
executeSoon(function() {
|
||||
expectedEventCount++;
|
||||
|
||||
is(plugin1.getTopLevelWindowActivationState(), true, "Activation state should be: activated");
|
||||
|
@ -72,6 +70,21 @@
|
|||
is(plugin2.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount);
|
||||
|
||||
window.opener.testsFinished();
|
||||
});
|
||||
}, false);
|
||||
|
||||
expectedEventCount++;
|
||||
|
||||
is(plugin1.getTopLevelWindowActivationState(), false, "Activation state should be: deactivated");
|
||||
is(plugin1.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount);
|
||||
|
||||
is(plugin2.getTopLevelWindowActivationState(), false, "Activation state should be: deactivated");
|
||||
is(plugin2.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount);
|
||||
|
||||
// Bring our window back to the front and make sure plugins were properly notified.
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
fm.focusedWindow = window;
|
||||
});
|
||||
}, false);
|
||||
|
||||
// Send our window to the back and make sure plugins were properly notified.
|
||||
|
|
Загрузка…
Ссылка в новой задаче