Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | let Cu = Components.utils; |
michael@0 | 5 | |
michael@0 | 6 | // Ideally we would use CrashTestUtils.jsm, but that's only available for |
michael@0 | 7 | // xpcshell tests - so we just copy a ctypes crasher from it. |
michael@0 | 8 | Cu.import("resource://gre/modules/ctypes.jsm"); |
michael@0 | 9 | let crash = function() { // this will crash when called. |
michael@0 | 10 | let zero = new ctypes.intptr_t(8); |
michael@0 | 11 | let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t)); |
michael@0 | 12 | badptr.contents |
michael@0 | 13 | }; |
michael@0 | 14 | |
michael@0 | 15 | |
michael@0 | 16 | TestHelper = { |
michael@0 | 17 | init: function() { |
michael@0 | 18 | addMessageListener("social-test:crash", this); |
michael@0 | 19 | }, |
michael@0 | 20 | |
michael@0 | 21 | receiveMessage: function(msg) { |
michael@0 | 22 | switch (msg.name) { |
michael@0 | 23 | case "social-test:crash": |
michael@0 | 24 | privateNoteIntentionalCrash(); |
michael@0 | 25 | crash(); |
michael@0 | 26 | break; |
michael@0 | 27 | } |
michael@0 | 28 | }, |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | TestHelper.init(); |