REGRESSION(r59100): Added test is broken on many platforms.
[WebKit-https.git] / LayoutTests / plugins / call-as-function-test.html
1 <html>
2 <head>
3     <script>
4         function doTest()
5         {
6             if (window.layoutTestController)
7                 layoutTestController.dumpAsText();
8
9             // Test calling bridged function with global window as "this"
10             var f = ("layoutTestController" in window) ? objCController.className : console.log;
11             
12             var result;
13             try {
14                 f("goodbye cruel world");
15                 result = "No Exception";
16             } catch (e) {
17                 result = e.name;
18             }
19
20             var output = document.getElementById("test1");
21             output.innerHTML = result + ": " + f;
22             var notAruntimeObject = { __apple_runtime_object:1 };
23             notAruntimeObject.f = f;
24             var result;
25             try {
26                 notAruntimeObject.f("goodbye cruel world");
27                 result = "No Exception";
28             } catch (e) {
29                 result = e.name;
30             }
31             
32             output = document.getElementById("test2");
33             output.innerHTML = result + ": " + f;
34         }
35     </script>
36 </head>
37 <body onload="doTest();">
38 <div id=test1>
39     <span style="color: red;">Test 1 FAILED: This is testing...</span>
40 </div>
41 <div id=test2>
42     <span style="color: red;">Test 2 FAILED: This is testing...</span>
43 </div>
44 </body>
45 </html>