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.
6 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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>
17 <h1>Native Client Post Message Name Service Test
</h1>
19 <embed id=
"naclModule"
22 src=
"pm_nameservice_test.nmf"
25 style=
"background-color:gray"
26 type=
"application/x-nacl" />
29 <script type=
"text/javascript">
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');
39 plugin
.postMessage('init');
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
,
47 +'ManifestNameService\n'
51 plugin
.postMessage('nameservice');
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);
59 plugin
.postMessage('rng');
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');
68 plugin
.postMessage('manifest_test');
72 var tester
= new Tester();
73 setupTests(tester
, $('naclModule'));
74 tester
.waitFor($('naclModule'));