1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <!-- Copyright 2011 Google Inc. All rights reserved. -->
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">
11 function setupTests(tester, plugin) {
12 function addTest(test_name, responses) {
13 if (responses === undefined) {
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)
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']);
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']);
46 <title>PPAPI PPB_Core Test</title>
49 <h1>PPAPI PPB_Core Test</h1>
51 <script type="text/javascript">
53 function createModule(id, src, type) {
54 return createNaClEmbed({
63 var mime = "application/x-nacl";
64 if (getTestArguments()["pnacl"] !== undefined) {
65 mime = "application/x-pnacl";
67 var embed = createModule("test_nexe", "ppapi_ppb_core.nmf", mime);
68 document.body.appendChild(embed);
70 var tester = new Tester();
71 setupTests(tester, $('test_nexe'));
72 tester.waitFor($('test_nexe'));