6 var li
= document
.createElement("li");
7 li
.appendChild(document
.createTextNode(str
));
8 var console
= document
.getElementById("console");
9 console
.appendChild(li
);
12 function assertEqual(message
, actual
, expected
)
14 if (actual
!= expected
)
15 log("\n" + message
+ ": Failure, actual: " + actual
+ "; expected: " + expected
);
17 log("\n" + message
+ ": Success");
21 if (window
.testRunner
) {
22 testRunner
.dumpAsText();
24 assertEqual("stringify", JSON
.stringify(window
.location
), '{"hash":"","search":"","pathname":"/dom/location-stringify.html","port":"8000","hostname":"127.0.0.1","host":"127.0.0.1:8000","protocol":"http:","origin":"http://127.0.0.1:8000","href":"http://127.0.0.1:8000/dom/location-stringify.html","ancestorOrigins":{}}');
28 <body onload=
"runTests();">
30 Tests that Location interface is [Unforgeable], thus JSON.stringify() works well for Location objects.
32 <ul id=
"console" dir=ltr
></ul>