| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright 2014 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 | |
| 19 <script type="text/javascript"> | |
| 20 //<![CDATA[ | |
| 21 function createModule(id, src, type) { | |
| 22 return createNaClEmbed({ | |
| 23 id: id, | |
| 24 src: src, | |
| 25 width: 400, | |
| 26 height: 400, | |
| 27 type: type | |
| 28 }); | |
| 29 } | |
| 30 var mime = 'application/x-nacl'; | |
| 31 if (getTestArguments()['pnacl'] !== undefined) { | |
| 32 mime = 'application/x-pnacl'; | |
| 33 } | |
| 34 var embed = createModule('naclModule', 'pm_nameservice_test.nmf', mime); | |
| 35 embed.basic_tests ='2'; | |
| 36 embed.stress_tests = '0'; | |
| 37 document.body.appendChild(embed); | |
| 38 | |
| 39 function setupTests(tester, plugin) { | |
| 40 tester.addAsyncTest('TestInit', function(status) { | |
| 41 plugin.addEventListener('message', function(message_event) { | |
| 42 this.removeEventListener('message', arguments.callee, false); | |
| 43 status.assertEqual(message_event.data, | |
| 44 'NaClSrpcClientCtor succeeded\n'); | |
| 45 status.pass(); | |
| 46 }, false); | |
| 47 plugin.postMessage('init'); | |
| 48 }); | |
| 49 tester.addAsyncTest('TestRng', function(status) { | |
| 50 plugin.addEventListener('message', function(message_event) { | |
| 51 this.removeEventListener('message', arguments.callee, false); | |
| 52 // alert(message_event.data); | |
| 53 status.pass(); | |
| 54 }, false); | |
| 55 plugin.postMessage('rng'); | |
| 56 }); | |
| 57 tester.addAsyncTest('TestManifest', function(status) { | |
| 58 plugin.addEventListener('message', function(message_event) { | |
| 59 this.removeEventListener('message', arguments.callee, false); | |
| 60 status.assertEqual(message_event.data, | |
| 61 'ManifestTest: basic connectivity ok\n'); | |
| 62 status.pass(); | |
| 63 }, false); | |
| 64 plugin.postMessage('manifest_test'); | |
| 65 }); | |
| 66 } | |
| 67 | |
| 68 var tester = new Tester(); | |
| 69 setupTests(tester, $('naclModule')); | |
| 70 tester.waitFor($('naclModule')); | |
| 71 tester.run(); | |
| 72 //]]> | |
| 73 </script> | |
| 74 </body> | |
| 75 </html> | |
| OLD | NEW |