Add 4-byte header to messages so that we can have different message types
[nativeclient.git] / imcplugin / imctest.html
blobf47ce8787a18b9b52434cd1f776ea30bda2b29ac
2 Testing plugin...
4 <object id="plugin" type="application/x-nacl-imc">Plugin not working</object>
6 <script type="text/javascript">
7 function onload() {
8 try {
9 var plugin = document.getElementById("plugin");
10 function receive(msg) {
11 dump("Javascript got message: \"" + msg + "\"\n");
13 plugin.get_file("imcread", function(file) {
14 dump("got file: " + file + "\n");
15 var proc = plugin.launch(file, ["arg1", "arg2"], receive);
16 dump("proc = " + proc + "\n");
17 proc.send("Hello from Javascript to NaCl!", []);
18 plugin.get_file("input.txt", function(file2) {
19 proc.send("Sending file FD", [file2]);
20 });
21 });
22 plugin.launch(1,2,3);
24 catch(e) {
25 dump(e + "\n");
28 window.onload = onload;
29 </script>