OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title>Calling bindings constructors as function should not cause a crash</t
itle> | 3 <title>Calling bindings constructors as function should not cause a crash</t
itle> |
4 <script> | 4 <script> |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 function runTest() | 8 function runTest() |
9 { | 9 { |
10 // List of constructors to test. | 10 // List of constructors to test. |
11 var constructors = ["EventSource", "MessageChannel", "SharedWorker",
"WebGLArrayBuffer", "WebKitCSSMatrix", "WebKitPoint", "WebSocket", "Worker", "X
MLHttpRequest", "XSLTProcessor"]; | 11 var constructors = ["EventSource", "MessageChannel", "SharedWorker",
"WebGLArrayBuffer", "WebKitCSSMatrix", "WebSocket", "Worker", "XMLHttpRequest",
"XSLTProcessor"]; |
12 var result = document.getElementById("result"); | 12 var result = document.getElementById("result"); |
13 for (var i in constructors) { | 13 for (var i in constructors) { |
14 try { | 14 try { |
15 var func = constructors[i] + "()"; | 15 var func = constructors[i] + "()"; |
16 eval(func); | 16 eval(func); |
17 result.innerHTML += "FAIL"; | 17 result.innerHTML += "FAIL"; |
18 } | 18 } |
19 catch (e) { | 19 catch (e) { |
20 result.innerHTML += "PASS"; | 20 result.innerHTML += "PASS"; |
21 } | 21 } |
22 result.innerHTML += ": " + constructors[i] + "<br/>"; | 22 result.innerHTML += ": " + constructors[i] + "<br/>"; |
23 } | 23 } |
24 } | 24 } |
25 | 25 |
26 </script> | 26 </script> |
27 </head> | 27 </head> |
28 <body onload="runTest()"> | 28 <body onload="runTest()"> |
29 <p>Calling <code>bindings</code> constructors as function should throw an ex
ception and not cause a crash.</p> | 29 <p>Calling <code>bindings</code> constructors as function should throw an ex
ception and not cause a crash.</p> |
30 <div id="result"></div> | 30 <div id="result"></div> |
31 </html> | 31 </html> |
32 | 32 |
OLD | NEW |