Chromium Code Reviews| Index: tests/untrusted_crash_dump/untrusted_crash_dump.html |
| diff --git a/tests/untrusted_crash_dump/untrusted_crash_dump.html b/tests/untrusted_crash_dump/untrusted_crash_dump.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c007e256c6ad2537480fcc98cbacc6c60014cdce |
| --- /dev/null |
| +++ b/tests/untrusted_crash_dump/untrusted_crash_dump.html |
| @@ -0,0 +1,66 @@ |
| +<!-- |
| + Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| + Use of this source code is governed by a BSD-style license that can be |
| + found in the LICENSE file. |
| +--> |
| + |
| +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
Mark Seaborn
2012/02/16 18:42:50
The HTML5 doctype is simpler :-)
bradn
2012/02/16 20:13:10
Done.
|
| + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| +<html> |
| + <head> |
| + <meta http-equiv="Pragma" content="no-cache" /> |
| + <meta http-equiv="Expires" content="-1" /> |
| + <script type="text/javascript" src="nacltest.js"></script> |
| + <title>Native Client Untrusted Crash Dump Test</title> |
| + </head> |
| + |
| + <body> |
| + <h1>Native Client Untrusted Crash Dump Test</h1> |
| + |
| +<div id="scratch_space"></div> |
| + |
| +<script type="text/javascript"> |
| + |
| +var tester = new Tester(); |
| + |
| +tester.addAsyncTest('untrusted_crash_dump', function(status) { |
| + var embed = document.createElement('embed'); |
| + embed.width = 0; |
| + embed.height = 0; |
| + embed.src = 'untrusted_crash_dump_test.nmf'; |
| + embed.type = 'application/x-nacl'; |
| + embed.name = 'foo'; |
| + |
| + // Webkit Bug Workaround |
| + // THIS SHOULD BE REMOVED WHEN Webkit IS FIXED |
| + // http://code.google.com/p/nativeclient/issues/detail?id=2428 |
| + // http://code.google.com/p/chromium/issues/detail?id=103588 |
| + ForcePluginLoadOnTimeout(embed, tester, 15000); |
| + |
| + var div = document.createElement('div'); |
| + div.appendChild(embed); |
| + |
| + div.addEventListener('load', status.wrap(function(event) { |
| + status.fail('We expected this process to crash during startup'); |
| + }), true); |
| + |
| + div.addEventListener('error', status.wrap(function(event) { |
| + status.log('Received error: ' + embed.lastError); |
| + status.assert( |
| + embed.lastError.indexOf('SRPC connection failure') != -1 || |
| + embed.lastError.indexOf('Nexe crashed during startup') != -1); |
| + status.pass(); |
| + }), true); |
| + |
| + div.addEventListener('crash', status.wrap(function(event) { |
| + status.log('Received crash: ' + embed.lastError); |
| + status.assert(embed.lastError.indexOf('NaCl module crashed') != -1); |
| + status.pass(); |
| + }), true); |
| + |
| + document.getElementById('scratch_space').appendChild(div); |
| +}); |
| + |
| +tester.run(); |
| + |
| +</script> |