Bug 599258 - Fix random orange on content/html/content/test/test_bug561636.html. r=jst a=test

This commit is contained in:
Mounir Lamouri 2010-09-24 17:14:50 -07:00
Родитель d2f081d3d0
Коммит a991e8fab6
1 изменённых файлов: 50 добавлений и 45 удалений

Просмотреть файл

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=561636
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<body onload="runTest();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=561636">Mozilla Bug 561636</a>
<p id="display"></p>
<iframe style='width:50px; height: 50px;' name='t'></iframe>
@ -48,9 +48,12 @@ 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();
@ -78,6 +81,9 @@ if (observers.hasMoreElements()) {
ok(!formSubmitted[1], "Form 2 should not have been submitted because invalid");
ok(!formSubmitted[2], "Form 3 should not have been submitted because invalid");
ok(formSubmitted[3], "Form 4 should have been submitted because valid");
// Next test.
document.forms[4].submit();
}, false);
document.forms[4].elements[0].addEventListener('invalid', function(aEvent) {
@ -101,8 +107,7 @@ if (observers.hasMoreElements()) {
var c = document.getElementById('c');
c.focus(); synthesizeKey("VK_RETURN", {type: "keypress"});
document.getElementById('s2').click();
document.forms[3].submit();
}
}
</script>