- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / native_client / tests / breakpad_crash_test / crash_in_syscall.html
1 <!--
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.
5 -->
6
7 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
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 Crash In Syscall Test</title>
15   </head>
16
17   <body>
18     <h1>Native Client Crash In Syscall 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('crash_in_syscall', function(status) {
27   var embed = document.createElement('embed');
28   embed.width = 0;
29   embed.height = 0;
30   embed.src = 'crash_in_syscall.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>
67 </body>
68 </html>