OLD | NEW |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 <html> | 3 <html> |
4 <!-- Copyright (c) 2011 Google Inc. All rights reserved. --> | 4 <!-- Copyright (c) 2011 Google Inc. All rights reserved. --> |
5 <head> | 5 <head> |
6 <meta http-equiv="Pragma" content="no-cache" /> | 6 <meta http-equiv="Pragma" content="no-cache" /> |
7 <meta http-equiv="Expires" content="-1" /> | 7 <meta http-equiv="Expires" content="-1" /> |
8 <script type="text/javascript" src="nacltest.js"></script> | 8 <script type="text/javascript" src="nacltest.js"></script> |
9 <title>Nexe Crash Test</title> | 9 <title>Nexe Crash Test</title> |
10 </head> | 10 </head> |
(...skipping 26 matching lines...) Expand all Loading... |
37 var tester = new Tester(); | 37 var tester = new Tester(); |
38 function AddTest(plugin, testName, expectedEvent, unexpectedEvent, | 38 function AddTest(plugin, testName, expectedEvent, unexpectedEvent, |
39 pingToDetectCrash) { | 39 pingToDetectCrash) { |
40 tester.addAsyncTest(testName, function(test) { | 40 tester.addAsyncTest(testName, function(test) { |
41 test.expectEvent(plugin, expectedEvent, | 41 test.expectEvent(plugin, expectedEvent, |
42 function(e) { test.pass(); }); | 42 function(e) { test.pass(); }); |
43 test.expectEvent(plugin, unexpectedEvent, | 43 test.expectEvent(plugin, unexpectedEvent, |
44 function(e) { test.fail(); }); | 44 function(e) { test.fail(); }); |
45 plugin.postMessage(testName); | 45 plugin.postMessage(testName); |
46 // In case the nexe does not crash right away, we will ping it | 46 // In case the nexe does not crash right away, we will ping it |
47 // until we detect that it's death. DidChangeView and other events | 47 // until we detect that it's dead. DidChangeView and other events |
48 // can do this too, but are less reliable. | 48 // can do this too, but are less reliable. |
49 if (pingToDetectCrash) { | 49 if (pingToDetectCrash) { |
50 function PingBack(message) { | 50 function PingBack(message) { |
51 test.log(message.data); | 51 test.log(message.data); |
52 plugin.postMessage('Ping'); | 52 plugin.postMessage('Ping'); |
53 } | 53 } |
54 plugin.addEventListener('message', PingBack, false); | 54 plugin.addEventListener('message', PingBack, false); |
55 plugin.postMessage("Ping"); | 55 plugin.postMessage("Ping"); |
56 } | 56 } |
57 }); | 57 }); |
58 tester.waitFor(plugin); | 58 tester.waitFor(plugin); |
59 } | 59 } |
60 | 60 |
61 AddTest($('crash_via_check_failure'), | 61 AddTest($('crash_via_check_failure'), |
62 'CrashViaCheckFailure', 'crash', 'error'); | 62 'CrashViaCheckFailure', 'crash', 'error'); |
63 AddTest($('crash_via_exit_call'), | 63 AddTest($('crash_via_exit_call'), |
64 'CrashViaExitCall', 'crash', 'error'); | 64 'CrashViaExitCall', 'crash', 'error'); |
65 AddTest($('crash_in_callback'), | 65 AddTest($('crash_in_callback'), |
66 'CrashInCallback', 'crash', 'error'); | 66 'CrashInCallback', 'crash', 'error'); |
67 AddTest($('crash_ppapi_off_main_thread'), | 67 AddTest($('crash_ppapi_off_main_thread'), |
68 'CrashPPAPIOffMainThread', 'crash', 'error'); | 68 'CrashPPAPIOffMainThread', 'crash', 'error'); |
69 AddTest($('crash_off_main_thread'), | 69 AddTest($('crash_off_main_thread'), |
70 'CrashOffMainThread', 'crash', 'error', true); | 70 'CrashOffMainThread', 'crash', 'error', true); |
71 | 71 |
72 tester.run(); | 72 tester.run(); |
73 //]]> | 73 //]]> |
74 </script> | 74 </script> |
75 </body> | 75 </body> |
76 </html> | 76 </html> |
OLD | NEW |