mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +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");
|
START("No Syntax Error when trailing space and XML.ignoreWhitespace true");
|
||||||
|
|
||||||
var bug = 324688;
|
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 actual = 'No Error';
|
||||||
var expect = 'No Error';
|
var expect = 'No Error';
|
||||||
|
|
||||||
if (typeof Components != 'undefined')
|
function init()
|
||||||
{
|
{
|
||||||
try
|
if (typeof Components != 'undefined')
|
||||||
{
|
{
|
||||||
netscape.security.PrivilegeManager.
|
try
|
||||||
enablePrivilege('UniversalXPConnect');
|
{
|
||||||
|
netscape.security.PrivilegeManager.
|
||||||
|
enablePrivilege('UniversalXPConnect');
|
||||||
|
|
||||||
var TestObject = {
|
var TestObject = {
|
||||||
observe: function () {
|
observe: function () {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
printBugNumber (bug);
|
printBugNumber (bug);
|
||||||
printStatus (summary);
|
printStatus (summary);
|
||||||
printStatus('Browser only: requires UniversalXPConnect');
|
printStatus('Browser only: requires UniversalXPConnect');
|
||||||
|
|
||||||
printStatus("XML.ignoreWhitespace=" +
|
printStatus("XML.ignoreWhitespace=" +
|
||||||
XML.ignoreWhitespace);
|
XML.ignoreWhitespace);
|
||||||
var x = new XML("<a></a> ");
|
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"].
|
var t = Components.classes["@mozilla.org/timer;1"].
|
||||||
createInstance(Components.interfaces.nsITimer);
|
createInstance(Components.interfaces.nsITimer);
|
||||||
t.init(TestObject, 100, t.TYPE_ONE_SHOT);
|
t.init(TestObject, 100, t.TYPE_ONE_SHOT);
|
||||||
}
|
}
|
||||||
catch(ex)
|
catch(ex)
|
||||||
{
|
{
|
||||||
printStatus('Requires UniversalXPConnect');
|
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