| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2014 The Chromium Authors. All rights reserved. | 3 Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <!-- This file has tests to make sure Non-SFI NaCl loads and starts | 7 <!-- This file has tests to make sure Non-SFI NaCl loads and starts |
| 8 up. libc_free.c is shared with irt_test.html where more IRT tests are | 8 up. libc_free.c is shared with irt_test.html where more IRT tests are |
| 9 done. --> | 9 done. --> |
| 10 <head> | 10 <head> |
| 11 <title>NaCl Load Test</title> | 11 <title>NaCl Load Test</title> |
| 12 </head> | 12 </head> |
| 13 <body> | 13 <body> |
| 14 <h2>NaCl Load Test</h2> | 14 <h2>NaCl Load Test</h2> |
| 15 </body> | 15 </body> |
| 16 <script type="text/javascript" src="nacltest.js"> </script> | 16 <script type="text/javascript" src="nacltest.js"> </script> |
| 17 <script> | 17 <script> |
| 18 | 18 |
| 19 function report(msg) { | 19 function report(msg) { |
| 20 domAutomationController.setAutomationId(0); | 20 domAutomationController.send(msg); |
| 21 // The automation controller seems to choke on Objects, so turn them into | |
| 22 // strings. | |
| 23 domAutomationController.send(JSON.stringify(msg)); | |
| 24 } | 21 } |
| 25 | 22 |
| 26 function create(manifest_url) { | 23 function create(manifest_url) { |
| 27 var embed = document.createElement("embed"); | 24 var embed = document.createElement("embed"); |
| 28 embed.src = manifest_url; | 25 embed.src = manifest_url; |
| 29 embed.type = "application/x-nacl"; | 26 embed.type = "application/x-nacl"; |
| 30 | 27 |
| 31 embed.addEventListener("error", function(evt) { | 28 embed.addEventListener("error", function(evt) { |
| 32 report({type: "Log", message: "Load error: " + embed.lastError}); | 29 report({type: "Log", message: "Load error: " + embed.lastError}); |
| 33 report({type: "Shutdown", message: "1 test failed.", passed: false}); | 30 report({type: "Shutdown", message: "1 test failed.", passed: false}); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 50 // Message is sent back. So, the test passes. | 47 // Message is sent back. So, the test passes. |
| 51 report({type: "Shutdown", message: "1 test passed.", passed: true}); | 48 report({type: "Shutdown", message: "1 test passed.", passed: true}); |
| 52 }, true); | 49 }, true); |
| 53 | 50 |
| 54 document.body.appendChild(embed); | 51 document.body.appendChild(embed); |
| 55 } | 52 } |
| 56 | 53 |
| 57 create("libc_free.nmf"); | 54 create("libc_free.nmf"); |
| 58 </script> | 55 </script> |
| 59 </html> | 56 </html> |
| OLD | NEW |