Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 Copyright (c) 2012 The Native Client Authors. All rights reserved. | |
| 3 Use of this source code is governed by a BSD-style license that can be | |
| 4 found in the LICENSE file. | |
| 5 --> | |
| 6 | |
| 7 <!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.
| |
| 8 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| 9 <html> | |
| 10 <head> | |
| 11 <meta http-equiv="Pragma" content="no-cache" /> | |
| 12 <meta http-equiv="Expires" content="-1" /> | |
| 13 <script type="text/javascript" src="nacltest.js"></script> | |
| 14 <title>Native Client Untrusted Crash Dump Test</title> | |
| 15 </head> | |
| 16 | |
| 17 <body> | |
| 18 <h1>Native Client Untrusted Crash Dump Test</h1> | |
| 19 | |
| 20 <div id="scratch_space"></div> | |
| 21 | |
| 22 <script type="text/javascript"> | |
| 23 | |
| 24 var tester = new Tester(); | |
| 25 | |
| 26 tester.addAsyncTest('untrusted_crash_dump', function(status) { | |
| 27 var embed = document.createElement('embed'); | |
| 28 embed.width = 0; | |
| 29 embed.height = 0; | |
| 30 embed.src = 'untrusted_crash_dump_test.nmf'; | |
| 31 embed.type = 'application/x-nacl'; | |
| 32 embed.name = 'foo'; | |
| 33 | |
| 34 // Webkit Bug Workaround | |
| 35 // THIS SHOULD BE REMOVED WHEN Webkit IS FIXED | |
| 36 // http://code.google.com/p/nativeclient/issues/detail?id=2428 | |
| 37 // http://code.google.com/p/chromium/issues/detail?id=103588 | |
| 38 ForcePluginLoadOnTimeout(embed, tester, 15000); | |
| 39 | |
| 40 var div = document.createElement('div'); | |
| 41 div.appendChild(embed); | |
| 42 | |
| 43 div.addEventListener('load', status.wrap(function(event) { | |
| 44 status.fail('We expected this process to crash during startup'); | |
| 45 }), true); | |
| 46 | |
| 47 div.addEventListener('error', status.wrap(function(event) { | |
| 48 status.log('Received error: ' + embed.lastError); | |
| 49 status.assert( | |
| 50 embed.lastError.indexOf('SRPC connection failure') != -1 || | |
| 51 embed.lastError.indexOf('Nexe crashed during startup') != -1); | |
| 52 status.pass(); | |
| 53 }), true); | |
| 54 | |
| 55 div.addEventListener('crash', status.wrap(function(event) { | |
| 56 status.log('Received crash: ' + embed.lastError); | |
| 57 status.assert(embed.lastError.indexOf('NaCl module crashed') != -1); | |
| 58 status.pass(); | |
| 59 }), true); | |
| 60 | |
| 61 document.getElementById('scratch_space').appendChild(div); | |
| 62 }); | |
| 63 | |
| 64 tester.run(); | |
| 65 | |
| 66 </script> | |
| OLD | NEW |