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

Unified Diff: ppapi/native_client/tests/ppapi_browser/crash/ppapi_crash.html

Issue 7741036: NaCl PPAPI Proxy: wrap up with crash detection. Clean-up handling code to skip remote shutdown ca... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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: ppapi/native_client/tests/ppapi_browser/crash/ppapi_crash.html
===================================================================
--- ppapi/native_client/tests/ppapi_browser/crash/ppapi_crash.html (revision 98327)
+++ ppapi/native_client/tests/ppapi_browser/crash/ppapi_crash.html (working copy)
@@ -23,21 +23,37 @@
name="nacl_module"
src="ppapi_crash_in_callback.nmf"
width="0" height="0" />
+ <embed type="application/x-nacl" id="crash_ppapi_off_main_thread"
+ name="nacl_module"
+ src="ppapi_crash_ppapi_off_main_thread.nmf"
+ width="0" height="0" />
+ <embed type="application/x-nacl" id="crash_off_main_thread"
+ name="nacl_module"
+ src="ppapi_crash_off_main_thread.nmf"
+ width="0" height="0" />
<script type="text/javascript">
//<![CDATA[
var tester = new Tester();
- function AddTest(plugin, testName, expectedHandler, unexpectedHandler) {
+ function AddTest(plugin, testName, expectedEvent, unexpectedEvent,
+ pingToDetectCrash) {
tester.addAsyncTest(testName, function(test) {
- plugin.addEventListener(
- expectedHandler,
- test.wrap(function(e) { test.pass(); }),
- false);
- plugin.addEventListener(
- unexpectedHandler,
- test.wrap(function(e) { test.fail(); }),
- false);
+ test.expectEvent(plugin, expectedEvent,
+ function(e) { test.pass(); });
+ test.expectEvent(plugin, unexpectedEvent,
+ function(e) { test.fail(); });
plugin.postMessage(testName);
+ // In case the nexe does not crash right away, we will ping it
+ // until we detect that it's death. DidChangeView and other events
+ // can do this too, but are less reliable.
+ if (pingToDetectCrash) {
+ function PingBack(message) {
+ test.log(message.data);
+ plugin.postMessage('Ping');
+ }
+ plugin.addEventListener('message', PingBack, false);
+ plugin.postMessage("Ping");
+ }
});
tester.waitFor(plugin);
}
@@ -46,7 +62,12 @@
'CrashViaCheckFailure', 'crash', 'error');
AddTest($('crash_via_exit_call'),
'CrashViaExitCall', 'crash', 'error');
- AddTest($('crash_in_callback'), 'CrashInCallback', 'crash', 'error');
+ AddTest($('crash_in_callback'),
+ 'CrashInCallback', 'crash', 'error');
+ AddTest($('crash_ppapi_off_main_thread'),
+ 'CrashPPAPIOffMainThread', 'crash', 'error');
+ AddTest($('crash_off_main_thread'),
+ 'CrashOffMainThread', 'crash', 'error', true);
tester.run();
//]]>

Powered by Google App Engine
This is Rietveld 408576698