mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
JavaScript Test - modify test to delay execution until page loaded, bug 324688
This commit is contained in:
parent
f7babbb055
commit
15f4576091
@ -39,46 +39,64 @@
|
||||
START("No Syntax Error when trailing space and XML.ignoreWhitespace true");
|
||||
|
||||
var bug = 324688;
|
||||
var summary = 'No Syntax Error when trailing space and XML.ignoreWhitespace true';
|
||||
var summary = 'No Syntax Error when trailing space and XML.ignoreWhitespace ' +
|
||||
'true';
|
||||
var actual = 'No Error';
|
||||
var expect = 'No Error';
|
||||
|
||||
if (typeof Components != 'undefined')
|
||||
function init()
|
||||
{
|
||||
try
|
||||
if (typeof Components != 'undefined')
|
||||
{
|
||||
netscape.security.PrivilegeManager.
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
try
|
||||
{
|
||||
netscape.security.PrivilegeManager.
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
|
||||
var TestObject = {
|
||||
var TestObject = {
|
||||
observe: function () {
|
||||
try
|
||||
{
|
||||
printBugNumber (bug);
|
||||
printStatus (summary);
|
||||
printStatus('Browser only: requires UniversalXPConnect');
|
||||
try
|
||||
{
|
||||
printBugNumber (bug);
|
||||
printStatus (summary);
|
||||
printStatus('Browser only: requires UniversalXPConnect');
|
||||
|
||||
printStatus("XML.ignoreWhitespace=" +
|
||||
XML.ignoreWhitespace);
|
||||
var x = new XML("<a></a> ");
|
||||
printStatus("XML.ignoreWhitespace=" +
|
||||
XML.ignoreWhitespace);
|
||||
var x = new XML("<a></a> ");
|
||||
}
|
||||
catch(ex2)
|
||||
{
|
||||
actual = ex2 + '';
|
||||
}
|
||||
print('expect = ' + expect);
|
||||
print('actual = ' + actual);
|
||||
TEST(1, expect, actual);
|
||||
END();
|
||||
}
|
||||
catch(ex2)
|
||||
{
|
||||
actual = ex2 + '';
|
||||
}
|
||||
TEST(1, expect, actual);
|
||||
END();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var t = Components.classes["@mozilla.org/timer;1"].
|
||||
createInstance(Components.interfaces.nsITimer);
|
||||
t.init(TestObject, 100, t.TYPE_ONE_SHOT);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
printStatus('Requires UniversalXPConnect');
|
||||
var t = Components.classes["@mozilla.org/timer;1"].
|
||||
createInstance(Components.interfaces.nsITimer);
|
||||
t.init(TestObject, 100, t.TYPE_ONE_SHOT);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
printStatus('Requires UniversalXPConnect');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof window != 'undefined')
|
||||
{
|
||||
// delay test driver end
|
||||
gDelayTestDriverEnd = true;
|
||||
|
||||
window.addEventListener("load", init, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
TEST(1, expect, actual);
|
||||
END();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user