4 <title>SRPC Simple Plug-in
</title>
6 <body onload=
"nacllib.waitForModulesAndRunTests();"
7 onunload=
"nacllib.cleanUp();" >
8 <script type=
"text/javascript">
12 alert(document
.getElementById('pluginobj').fortytwo());
18 function helloworld() {
20 alert(document
.getElementById('pluginobj').helloworld());
28 <h1>Native Client SRPC Simple Plug-in
</h1>
30 <button onclick='fortytwo()'
>Call fortytwo()
</button>
31 <button onclick='helloworld()'
>Call helloworld()
</button>
33 <embed name=
"nacl_module"
37 type=
"application/x-nacl-srpc" />
40 <p>If the plug-in is working correctly, a click on the
"Call fortytwo" button
41 should open a popup dialog containing
<b>42</b> as value.
</p>
43 <p> Clicking on the
"Call helloworld" button
44 should open a popup dialog containing
<b>hello, world
</b> as value.
</p>
47 <div id=status
>NO-STATUS
</div>
49 <script type=
"text/javascript" src=
"nacl_js_lib.js"></script>
50 <script type=
"text/javascript">
52 var nacllib
= new NaclLib(document
.getElementsByName("nacl_module"),
53 document
.getElementById("status"),
56 nacllib
.test = function() {
57 var plugin
= document
.getElementById("pluginobj");
58 if ('42' != plugin
.fortytwo()) {
62 if ('hello, world.' != plugin
.helloworld()) {
63 return "expected 'hello, world.'";