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.
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 _SC_NPROCESSORS_ONLN Test</title>
17 <h1>Native Client _SC_NPROCESSORS_ONLN Test</h1>
18 <script type="text/javascript">
20 var tester = new Tester($('body'));
21 var args = getTestArguments({'cpu_count' :
22 'THIS TEST CANNOT RUN STANDALONE -- run using browser_test instead'});
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";
31 document.body.appendChild(embed);
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);
42 plugin.postMessage("nprocessors");
47 var module = setupModule("sysconf_nprocessors_onln_test.nmf");
48 setupTests(tester, module);
49 tester.waitFor(module);