OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <!-- |
| 3 Copyright (c) 2012 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 </head> |
| 10 <body> |
| 11 <h2>NaCl Load Test</h2> |
| 12 </body> |
| 13 <script> |
| 14 |
| 15 function report(msg) { |
| 16 domAutomationController.setAutomationId(0); |
| 17 // The automation controller seems to choke on Objects, so turn them into |
| 18 // strings. |
| 19 domAutomationController.send(JSON.stringify(msg)); |
| 20 } |
| 21 |
| 22 function create(manifest_url) { |
| 23 var embed = document.createElement("embed"); |
| 24 embed.src = manifest_url; |
| 25 embed.type = "application/x-nacl"; |
| 26 |
| 27 embed.addEventListener("load", function(evt) { |
| 28 report({type: "Shutdown", message: "1 test passed.", passed: true}); |
| 29 }, true); |
| 30 |
| 31 embed.addEventListener("error", function(evt) { |
| 32 report({type: "Log", message: "Load error: " + embed.lastError}); |
| 33 report({type: "Shutdown", message: "1 test failed.", passed: false}); |
| 34 }, true); |
| 35 |
| 36 document.body.appendChild(embed); |
| 37 } |
| 38 |
| 39 create("simple.nmf"); |
| 40 </script> |
| 41 </html> |
OLD | NEW |