OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/WindowProperties.js"></script> | 4 <script src="resources/WindowProperties.js"></script> |
5 <script> | 5 <script> |
6 if (window.testRunner) | 6 if (window.testRunner) |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
8 | 8 |
9 function log(message, color) | 9 function log(message, color) |
10 { | 10 { |
(...skipping 20 matching lines...) Expand all Loading... |
31 log("FAIL: " + a + " should be " + b + " but instead is " + eval
A, "red"); | 31 log("FAIL: " + a + " should be " + b + " but instead is " + eval
A, "red"); |
32 } | 32 } |
33 | 33 |
34 function testFunction(functionName) | 34 function testFunction(functionName) |
35 { | 35 { |
36 var iframe = document.createElement('iframe'); | 36 var iframe = document.createElement('iframe'); |
37 iframe.src = "about:blank"; | 37 iframe.src = "about:blank"; |
38 iframe.name = functionName; | 38 iframe.name = functionName; |
39 document.body.appendChild(iframe); | 39 document.body.appendChild(iframe); |
40 | 40 |
41 // showModalDialog only works on mac in the DRT. So run this test o
nly if its defined and print output only on failure. | 41 shouldBe("typeof window." + functionName, "object"); |
42 // This'll keep the output consistent on all platforms. | |
43 if (functionName == "showModalDialog") { | |
44 if (window.showModalDialog != undefined) | |
45 shouldBe("typeof window." + functionName, "object", true); | |
46 } else | |
47 shouldBe("typeof window." + functionName, "object"); | |
48 | 42 |
49 document.body.removeChild(iframe); | 43 document.body.removeChild(iframe); |
50 } | 44 } |
51 | 45 |
52 function runTests() | 46 function runTests() |
53 { | 47 { |
54 for (var func in windowFunctions) { | 48 for (var func in windowFunctions) { |
55 testFunction(windowFunctions[func]) | 49 testFunction(windowFunctions[func]) |
56 } | 50 } |
57 | 51 |
58 window.myFunction = function() { return "myFunction"; } | 52 window.myFunction = function() { return "myFunction"; } |
59 testFunction("myFunction"); | 53 testFunction("myFunction"); |
60 window.__proto__.myPrototypeFunction = function() { return "myProtot
ypeFunction"; } | 54 window.__proto__.myPrototypeFunction = function() { return "myProtot
ypeFunction"; } |
61 testFunction("myPrototypeFunction"); | 55 testFunction("myPrototypeFunction"); |
62 } | 56 } |
63 </script> | 57 </script> |
64 </head> | 58 </head> |
65 <body onload="runTests();"> | 59 <body onload="runTests();"> |
66 <p>This tests that a frame with a the same name as function on the window ob
ject, has precedence in the lookup.</p> | 60 <p>This tests that a frame with a the same name as function on the window ob
ject, has precedence in the lookup.</p> |
67 <pre id="console"></pre> | 61 <pre id="console"></pre> |
68 </body> | 62 </body> |
69 </html> | 63 </html> |
OLD | NEW |