REGRESSION(r59100): Added test is broken on many platforms.
[WebKit-https.git] / LayoutTests / plugins / jsobjc-simple.html
1 <html>
2 <head><title> simple.html </title>
3 <script>
4 function print(message) {
5     var paragraph = document.createElement('p');
6     paragraph.appendChild(document.createTextNode(message));
7     document.getElementById('console').appendChild(paragraph);
8 }
9
10 function test() {
11     if (window.layoutTestController)
12         layoutTestController.dumpAsText();
13     if (!window.objCPlugin)
14         return print('FAIL - no objCPlugin');
15     objCPlugin.removeBridgeRestrictions_(window);
16     if (!window.objc)
17         return print('FAIL - no window.objc');
18     
19     // test creating an obj-c object
20     var NSCell = objc('NSCell');
21     print('got class: ' + NSCell);
22     var cell = NSCell.alloc().init().autorelease();
23     print('created object: <' + cell.className() + '>');
24     cell.setValue_forKey_('zoe', 'stringValue');
25     print('set string value: ' + cell.stringValue());
26     if (cell.stringValue() == 'zoe')
27         print('PASS');
28     else
29         print('FAIL');
30 }
31 </script>
32 </head>
33 <body onload="test();">
34 <div id='console'/>
35 </body>
36 </html>