browser/base/content/test/social/social_crash_content_helper.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

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.)

     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("social-test:crash", this);
    19   },
    21   receiveMessage: function(msg) {
    22     switch (msg.name) {
    23       case "social-test:crash":
    24         privateNoteIntentionalCrash();
    25         crash();
    26       break;
    27     }
    28   },
    29 }
    31 TestHelper.init();

mercurial