- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / sysconf_nprocessors_onln / sysconf_nprocessors_onln_test.html
1 <!--
2   Copyright 2013 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 _SC_NPROCESSORS_ONLN Test</title>
14   </head>
15
16   <body id="body">
17     <h1>Native Client _SC_NPROCESSORS_ONLN Test</h1>
18     <script type="text/javascript">
19     //<![CDATA[
20 var tester = new Tester($('body'));
21 var args = getTestArguments({'cpu_count' :
22   'THIS TEST CANNOT RUN STANDALONE -- run using browser_test instead'});
23
24 function setupModule(manifest_url) {
25   var embed = document.createElement("embed");
26   embed.src = manifest_url;
27   embed.type = "application/x-nacl";
28   if (getTestArguments()["pnacl"] !== undefined) {
29     embed.type = "application/x-pnacl";
30   }
31   document.body.appendChild(embed);
32   return embed;
33 }
34
35 function setupTests(tester, plugin) {
36   tester.addAsyncTest("TestSysconfNprocessors", function(status) {
37     plugin.addEventListener("message", function handler(message_event) {
38       this.removeEventListener("message", handler, false);
39       status.assertEqual(message_event.data, args.cpu_count);
40       status.pass();
41     }, false);
42     plugin.postMessage("nprocessors");
43   });
44 }
45
46 function runTests() {
47   var module = setupModule("sysconf_nprocessors_onln_test.nmf");
48   setupTests(tester, module);
49   tester.waitFor(module);
50   tester.run();
51 }
52
53 runTests();
54     //]]>
55     </script>
56   </body>
57 </html>