Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1483)

Unified Diff: tests/inbrowser_untrusted_crash_dump_test/untrusted_crash_dump.html

Issue 9316125: Adding untrusted crash dump / stack trace tests. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: fixing 64-bit build issue Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/inbrowser_untrusted_crash_dump_test/untrusted_crash_dump.html
diff --git a/tests/inbrowser_untrusted_crash_dump_test/untrusted_crash_dump.html b/tests/inbrowser_untrusted_crash_dump_test/untrusted_crash_dump.html
new file mode 100644
index 0000000000000000000000000000000000000000..66de0bee09dc65466ae6474a4757aace7425eaa6
--- /dev/null
+++ b/tests/inbrowser_untrusted_crash_dump_test/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"
+ "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 = 'inbrowser_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>

Powered by Google App Engine
This is Rietveld 408576698