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