Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 let Cu = Components.utils;
6 // Ideally we would use CrashTestUtils.jsm, but that's only available for
7 // xpcshell tests - so we just copy a ctypes crasher from it.
8 Cu.import("resource://gre/modules/ctypes.jsm");
9 let crash = function() { // this will crash when called.
10 let zero = new ctypes.intptr_t(8);
11 let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
12 badptr.contents
13 };
16 TestHelper = {
17 init: function() {
18 addMessageListener("thumbnails-test:crash", this);
19 },
21 receiveMessage: function(msg) {
22 switch (msg.name) {
23 case "thumbnails-test:crash":
24 privateNoteIntentionalCrash();
25 crash();
26 break;
27 }
28 },
29 }
31 TestHelper.init();