| <html> |
| <head> |
| <script> |
| function doTest() |
| { |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| // Test calling bridged function with global window as "this" |
| var f = ("testRunner" in window) ? objCController.className : console.log; |
| |
| var result; |
| try { |
| f("goodbye cruel world"); |
| result = "No Exception"; |
| } catch (e) { |
| result = e.name; |
| } |
| |
| var output = document.getElementById("test1"); |
| output.innerHTML = result + ": " + f; |
| var notAruntimeObject = { __apple_runtime_object:1 }; |
| notAruntimeObject.f = f; |
| var result; |
| try { |
| notAruntimeObject.f("goodbye cruel world"); |
| result = "No Exception"; |
| } catch (e) { |
| result = e.name; |
| } |
| |
| output = document.getElementById("test2"); |
| output.innerHTML = result + ": " + f; |
| } |
| </script> |
| </head> |
| <body onload="doTest();"> |
| <div id=test1> |
| <span style="color: red;">Test 1 FAILED: This is testing...</span> |
| </div> |
| <div id=test2> |
| <span style="color: red;">Test 2 FAILED: This is testing...</span> |
| </div> |
| </body> |
| </html> |