Chromium Code Reviews| Index: tests/srpc_hw/srpc_hw.html |
| =================================================================== |
| --- tests/srpc_hw/srpc_hw.html (revision 4284) |
| +++ tests/srpc_hw/srpc_hw.html (working copy) |
| @@ -9,38 +9,47 @@ |
| onunload="nacllib.cleanUp();" > |
| <script type="text/javascript"> |
| //<![CDATA[ |
| +function $(id) { |
|
polina
2011/02/09 21:54:41
This helper is used only once. It would be nice to
|
| + return document.getElementById(id); |
| +} |
| + |
| +function setStatus(message) { |
| + var status = $("status"); |
| + status.firstChild.nodeValue = message; |
| +} |
| + |
| function fortytwo() { |
| var result = ""; |
| try { |
| - result = document.getElementById('pluginobj').fortytwo(); |
| + result = document.getElementById("pluginobj").fortytwo(); |
| } catch(e) { |
| result = "ERROR: " + e; |
| } |
| - alert("" + result); |
| + setStatus(result); |
| } |
| function helloworld() { |
| var result = ""; |
| try { |
| - result = document.getElementById('pluginobj').helloworld(); |
| + result = document.getElementById("pluginobj").helloworld(); |
| } catch(e) { |
| result = "ERROR: " + e; |
| } |
| - alert("" + result); |
| + setStatus(result); |
| } |
| //]]> |
| </script> |
| <h1>Native Client SRPC Simple Plug-in</h1> |
| <p> |
| - <button onclick='fortytwo()'>Call fortytwo()</button> |
| - <button onclick='helloworld()'>Call helloworld()</button> |
| + <button onclick="fortytwo()">Call fortytwo()</button> |
| + <button onclick="helloworld()">Call helloworld()</button> |
| <embed name="nacl_module" |
| id="pluginobj" |
| width=0 height=0 |
| src="srpc_hw.nexe" |
| - type="application/x-nacl-srpc" /> |
| + type="application/x-nacl" /> |
| </p> |
| <p>If the plug-in is working correctly, a click on the "Call fortytwo" button |
| @@ -63,7 +72,7 @@ |
| return "expected 42"; |
| } |
| - if ('hello, world.' != plugin.helloworld()) { |
| + if ("hello, world." != plugin.helloworld()) { |
| return "expected 'hello, world.'"; |
| } |