toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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();

mercurial