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.
michael@0 | 1 | // enable crash reporting first |
michael@0 | 2 | let cwd = Components.classes["@mozilla.org/file/directory_service;1"] |
michael@0 | 3 | .getService(Components.interfaces.nsIProperties) |
michael@0 | 4 | .get("CurWorkD", Components.interfaces.nsILocalFile); |
michael@0 | 5 | |
michael@0 | 6 | // get the temp dir |
michael@0 | 7 | let env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment); |
michael@0 | 8 | let _tmpd = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); |
michael@0 | 9 | _tmpd.initWithPath(env.get("XPCSHELL_TEST_TEMP_DIR")); |
michael@0 | 10 | |
michael@0 | 11 | let crashReporter = |
michael@0 | 12 | Components.classes["@mozilla.org/toolkit/crash-reporter;1"] |
michael@0 | 13 | .getService(Components.interfaces.nsICrashReporter); |
michael@0 | 14 | |
michael@0 | 15 | // We need to call this or crash events go in an undefined location. |
michael@0 | 16 | crashReporter.UpdateCrashEventsDir(); |
michael@0 | 17 | |
michael@0 | 18 | // Setting the minidump path is not allowed in content processes |
michael@0 | 19 | let processType = Components.classes["@mozilla.org/xre/runtime;1"]. |
michael@0 | 20 | getService(Components.interfaces.nsIXULRuntime).processType; |
michael@0 | 21 | if (processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) { |
michael@0 | 22 | crashReporter.minidumpPath = _tmpd; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | let ios = Components.classes["@mozilla.org/network/io-service;1"] |
michael@0 | 26 | .getService(Components.interfaces.nsIIOService); |
michael@0 | 27 | let protocolHandler = ios.getProtocolHandler("resource") |
michael@0 | 28 | .QueryInterface(Components.interfaces.nsIResProtocolHandler); |
michael@0 | 29 | let curDirURI = ios.newFileURI(cwd); |
michael@0 | 30 | protocolHandler.setSubstitution("test", curDirURI); |
michael@0 | 31 | Components.utils.import("resource://test/CrashTestUtils.jsm"); |
michael@0 | 32 | let crashType = CrashTestUtils.CRASH_INVALID_POINTER_DEREF; |