| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>SRPC Simple Plug-in</title> | |
| 5 <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> | |
| 6 <META HTTP-EQUIV="Expires" CONTENT="-1" /> | |
| 7 </head> | |
| 8 <body onload="nacllib.waitForModulesAndRunTests();" | |
| 9 onunload="nacllib.cleanUp();" > | |
| 10 <script type="text/javascript"> | |
| 11 //<![CDATA[ | |
| 12 function fortytwo() { | |
| 13 var result = ""; | |
| 14 try { | |
| 15 result = document.getElementById('pluginobj').fortytwo(); | |
| 16 } catch(e) { | |
| 17 result = "ERROR: " + e; | |
| 18 } | |
| 19 alert("" + result); | |
| 20 } | |
| 21 | |
| 22 function helloworld() { | |
| 23 var result = ""; | |
| 24 try { | |
| 25 result = document.getElementById('pluginobj').helloworld(); | |
| 26 } catch(e) { | |
| 27 result = "ERROR: " + e; | |
| 28 } | |
| 29 alert("" + result); | |
| 30 } | |
| 31 //]]> | |
| 32 </script> | |
| 33 | |
| 34 <h1>Native Client SRPC Simple Plug-in</h1> | |
| 35 <p> | |
| 36 <button onclick='fortytwo()'>Call fortytwo()</button> | |
| 37 <button onclick='helloworld()'>Call helloworld()</button> | |
| 38 | |
| 39 <embed name="nacl_module" | |
| 40 id="pluginobj" | |
| 41 width=0 height=0 | |
| 42 src="srpc_hw.nexe" | |
| 43 type="application/x-nacl" /> | |
| 44 </p> | |
| 45 | |
| 46 <p>If the plug-in is working correctly, a click on the "Call fortytwo" button | |
| 47 should open a popup dialog containing <b>42</b> as value.</p> | |
| 48 | |
| 49 <p> Clicking on the "Call helloworld" button | |
| 50 should open a popup dialog containing <b>hello, world</b> as value.</p> | |
| 51 | |
| 52 <h2>Status</h2> | |
| 53 <div id=status>NO-STATUS</div> | |
| 54 | |
| 55 <script type="text/javascript" src="nacl_js_lib.js"></script> | |
| 56 <script type="text/javascript"> | |
| 57 //<![CDATA[ | |
| 58 var nacllib = new NaclLib("nacl_module", "status", 500); | |
| 59 | |
| 60 nacllib.test = function() { | |
| 61 var plugin = document.getElementById("pluginobj"); | |
| 62 if ('42' != plugin.fortytwo()) { | |
| 63 return "expected 42"; | |
| 64 } | |
| 65 | |
| 66 if ('hello, world.' != plugin.helloworld()) { | |
| 67 return "expected 'hello, world.'"; | |
| 68 } | |
| 69 | |
| 70 document.cookie = 'status=OK'; | |
| 71 | |
| 72 return ""; | |
| 73 }; | |
| 74 //]]> | |
| 75 </script> | |
| 76 | |
| 77 </body> | |
| 78 </html> | |
| OLD | NEW |