2 Copyright (c) 2011 The Chromium 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.
7 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
8 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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 Test
</title>
18 <h1>Native Client Untrusted Crash Test
</h1>
20 <div id=
"scratch_space"></div>
22 <script type=
"text/javascript">
24 var tester
= new Tester();
26 tester
.addAsyncTest('untrusted_crash', function(status
) {
27 var embed
= document
.createElement('embed');
30 embed
.src
= 'crash_test.nmf';
31 embed
.type
= 'application/x-nacl';
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);
40 var div
= document
.createElement('div');
41 div
.appendChild(embed
);
43 div
.addEventListener('load', status
.wrap(function(event
) {
44 status
.fail('We expected this process to crash during startup');
47 div
.addEventListener('error', status
.wrap(function(event
) {
48 status
.log('Received error: ' + embed
.lastError
);
50 embed
.lastError
.indexOf('SRPC connection failure') != -1 ||
51 embed
.lastError
.indexOf('Nexe crashed during startup') != -1);
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);
61 document
.getElementById('scratch_space').appendChild(div
);