зеркало из https://github.com/mozilla/pjs.git
Bug 599628 - Fix test timeout for Gecko consumers without invalidformsubmit observers. r=callek a=test
This commit is contained in:
Родитель
61bc265749
Коммит
a304794495
|
@ -40,6 +40,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=561636
|
|||
|
||||
/** Test for Bug 561636 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest()
|
||||
{
|
||||
var formSubmitted = [ false, false ];
|
||||
var invalidHandled = false;
|
||||
|
||||
|
@ -48,14 +52,13 @@ var os = Components.classes['@mozilla.org/observer-service;1']
|
|||
.getService(Components.interfaces.nsIObserverService);
|
||||
var observers = os.enumerateObservers("invalidformsubmit");
|
||||
|
||||
function runTest()
|
||||
{
|
||||
// The following test should not be done if there is no observer for
|
||||
// "invalidformsubmit" because the form submission will not be canceled in that
|
||||
// case.
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
if (observers.hasMoreElements()) {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
if (!observers.hasMoreElements()) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
document.forms[0].addEventListener('submit', function(aEvent) {
|
||||
|
@ -108,7 +111,6 @@ function runTest()
|
|||
c.focus(); synthesizeKey("VK_RETURN", {type: "keypress"});
|
||||
document.getElementById('s2').click();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
|
Загрузка…
Ссылка в новой задаче