- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / pnacl_nmf_options / pnacl_options.html
1 <html>
2 <!--
3 Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <head>
8 <title>NaCl Load Test</title>
9 <script type="text/javascript" src="nacltest.js"></script> 
10 </head>
11 <body>
12 <h2>PNaCl Load Options Test</h2>
13 </body>
14 <script>
15
16 function report(msg) {
17   domAutomationController.setAutomationId(0);
18   // The automation controller seems to choke on Objects, so turn them into
19   // strings.
20   domAutomationController.send(JSON.stringify(msg));
21 }
22
23 function create(manifest_prefix, manifest_opt) {
24   var embed = document.createElement("embed");
25   var nmf_url = manifest_prefix + manifest_opt + ".nmf";
26
27   embed.src = nmf_url;
28   embed.type = "application/x-pnacl";
29
30   embed.addEventListener("load", function(evt) {
31     report({type: "Shutdown", message: "1 test passed.", passed: true});
32   }, true);
33
34   embed.addEventListener("error", function(evt) {
35     report({type: "Log", message: "Load error: " + embed.lastError});
36     report({type: "Shutdown", message: "1 test failed.", passed: false});
37   }, true);
38
39   document.body.appendChild(embed);
40 }
41
42 var nmf_to_test = getTestArguments(
43   {'use_nmf' : 'Unknown NMF choice'})['use_nmf'];
44
45 create("pnacl_", nmf_to_test);
46 </script>
47 </html>