- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / ppapi / ppb_core / ppapi_ppb_core.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4   <!-- Copyright 2011 Google Inc.  All rights reserved. -->
5   <head>
6     <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
7     <META HTTP-EQUIV="Expires" CONTENT="-1" />
8     <script type="text/javascript" src="nacltest.js"></script>
9     <script type="application/x-javascript">
10       //<![CDATA[
11       function setupTests(tester, plugin) {
12         function addTest(test_name, responses) {
13           if (responses === undefined) {
14             responses = [];
15           }
16           var expected_messages = [test_name + ':PASSED'].concat(responses);
17           tester.addAsyncTest('PPB_Core::' + test_name, function(test) {
18             test.expectMessageSequence(plugin, expected_messages);
19             plugin.postMessage(test_name)
20           });
21         }
22
23         // Off the main thread.
24         // Doing these tests first will check that the proxy is properly
25         // caching the interface pointers on the main thread on initialization.
26         addTest('TestCallOnMainThread_FromNonMainThread',
27                 ['CallOnMainThreadCallback_FromNonMainThread']);
28         addTest('TestCallOnMainThread_FromNonMainThreadStress',
29                 ['CallOnMainThreadCallback_ThreadStress']);
30
31         // On the main thread.
32         addTest('TestGetTime');
33         addTest('TestGetTimeTicks');
34         addTest('TestIsMainThread_FromMainThread');
35         addTest('TestIsMainThread_FromNonMainThread');
36         addTest('TestAddRefAndReleaseResource');
37         addTest('TestAddRefAndReleaseInvalidResource');
38         addTest('TestCallOnMainThread_FromMainThread',
39                 ['CallOnMainThreadCallback_FromMainThread']);
40         addTest('TestCallOnMainThread_FromMainThreadDelayed',
41                 ['CallOnMainThreadCallback_FromMainThreadDelayed']);
42
43       }
44       //]]>
45     </script>
46     <title>PPAPI PPB_Core Test</title>
47   </head>
48   <body>
49     <h1>PPAPI PPB_Core Test</h1>
50
51     <script type="text/javascript">
52       //<![CDATA[
53       function createModule(id, src, type) {
54         return createNaClEmbed({
55           id: id,
56           src: src,
57           width: 0,
58           height: 0,
59           type: type
60         });
61       }
62
63       var mime = "application/x-nacl";
64       if (getTestArguments()["pnacl"] !== undefined) {
65         mime = "application/x-pnacl";
66       }
67       var embed = createModule("test_nexe", "ppapi_ppb_core.nmf", mime);
68       document.body.appendChild(embed);
69
70       var tester = new Tester();
71       setupTests(tester, $('test_nexe'));
72       tester.waitFor($('test_nexe'));
73       tester.run();
74       //]]>
75     </script>
76   </body>
77 </html>