OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
3 Use of this source code is governed by a BSD-style license that can | |
4 be found in the LICENSE file. | |
5 --> | |
6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
8 <html> | |
9 <head> | |
10 <meta http-equiv="Pragma" content="no-cache" /> | |
11 <meta http-equiv="Expires" content="-1" /> | |
12 <script type="text/javascript" src="nacltest.js"></script> | |
13 <title>Native Client Post Message Name Service Test</title> | |
14 </head> | |
15 | |
16 <body> | |
17 <h1>Native Client Post Message Name Service Test</h1> | |
18 <div> | |
19 <embed id="naclModule" | |
20 name="naclModule" | |
21 width=400 height=400 | |
22 src="pm_nameservice_test.nmf" | |
23 basic_tests="2" | |
24 stress_tests="0" | |
25 style="background-color:gray" | |
26 type="application/x-nacl" /> | |
27 </div> | |
28 | |
29 <script type="text/javascript"> | |
30 //<![CDATA[ | |
31 function setupTests(tester, plugin) { | |
32 tester.addAsyncTest('TestInit', function(status) { | |
33 plugin.addEventListener('message', function(message_event) { | |
34 this.removeEventListener('message', arguments.callee, false); | |
35 status.assertEqual(message_event.data, | |
36 'NaClSrpcClientCtor succeeded\n'); | |
37 status.pass(); | |
38 }, false); | |
39 plugin.postMessage('init'); | |
40 }); | |
41 tester.addAsyncTest('TestNameService', function(status) { | |
42 plugin.addEventListener('message', function(message_event) { | |
43 this.removeEventListener('message', arguments.callee, false); | |
44 status.assertEqual(message_event.data, | |
45 'nbytes = 47\n' | |
46 +'KernelService\n' | |
47 +'ManifestNameService\n' | |
48 +'SecureRandom\n'); | |
49 status.pass(); | |
50 }, false); | |
51 plugin.postMessage('nameservice'); | |
52 }); | |
53 tester.addAsyncTest('TestRng', function(status) { | |
54 plugin.addEventListener('message', function(message_event) { | |
55 this.removeEventListener('message', arguments.callee, false); | |
56 // alert(message_event.data); | |
57 status.pass(); | |
58 }, false); | |
59 plugin.postMessage('rng'); | |
60 }); | |
61 tester.addAsyncTest('TestManifest', function(status) { | |
62 plugin.addEventListener('message', function(message_event) { | |
63 this.removeEventListener('message', arguments.callee, false); | |
64 status.assertEqual(message_event.data, | |
65 'ManifestTest: basic connectivity ok\n'); | |
66 status.pass(); | |
67 }, false); | |
68 plugin.postMessage('manifest_test'); | |
69 }); | |
70 } | |
71 | |
72 var tester = new Tester(); | |
73 setupTests(tester, $('naclModule')); | |
74 tester.waitFor($('naclModule')); | |
75 tester.run(); | |
76 //]]> | |
77 </script> | |
78 </body> | |
79 </html> | |
OLD | NEW |