bug 733501 - Fix crashreporter xpcshell tests to actually run. r=jmaher
authorTed Mielczarek <ted.mielczarek@gmail.com>
Thu, 13 Sep 2012 15:43:28 -0400
changeset 108112 99372a4caf762d49253afde8d4cf52e878548da2
parent 108111 f0768a9d3a043956f969a31066642866c18bf586
child 108113 42b4cad82f1af1b8be3b2a91863b00c5baf48117
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersjmaher
bugs733501
milestone18.0a1
bug 733501 - Fix crashreporter xpcshell tests to actually run. r=jmaher
configure.in
testing/xpcshell/xpcshell.ini
toolkit/crashreporter/test/CrashTestUtils.jsm
toolkit/crashreporter/test/unit/xpcshell.ini
--- a/configure.in
+++ b/configure.in
@@ -8797,18 +8797,22 @@ if test -n "$MOZ_WEBRTC"; then
      ${srcdir}/media/webrtc/trunk/testing/gtest.gyp
    if test "$?" != 0; then
       AC_MSG_ERROR([failed to generate gtest Makefiles])
    fi
 fi
 
 # Generate a JSON config file for unittest harnesses etc to read
 # build configuration details from in a standardized way.
-OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
-MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
+OS_TARGET=${OS_TARGET} \
+TARGET_CPU=${TARGET_CPU} \
+MOZ_DEBUG=${MOZ_DEBUG} \
+MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} \
+UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
+MOZ_CRASHREPORTER=${MOZ_CRASHREPORTER} \
   $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
 if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
   rm ./mozinfo.json.tmp
 else
   mv -f ./mozinfo.json.tmp ./mozinfo.json
 fi
 
 # Run jemalloc configure script
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -96,17 +96,17 @@ skip-if = os == "android"
 [include:extensions/spellcheck/hunspell/tests/unit/xpcshell.ini]
 [include:toolkit/components/search/tests/xpcshell/xpcshell.ini]
 [include:toolkit/mozapps/shared/test/unit/xpcshell.ini]
 [include:services/crypto/component/tests/unit/xpcshell.ini]
 [include:layout/tools/layout-debug/tests/unit/xpcshell.ini]
 skip-if = !debug
 
 [include:toolkit/crashreporter/test/unit/xpcshell.ini]
-skip-if = os == "linux" || !crashreporter
+skip-if = !crashreporter
 
 [include:toolkit/crashreporter/test/unit_ipc/xpcshell.ini]
 skip-if = !crashreporter
 
 #XXX: we don't actually set os = maemo
 [include:toolkit/crashreporter/client/maemo-unit/xpcshell.ini]
 run-if = os == "maemo"
 
--- a/toolkit/crashreporter/test/CrashTestUtils.jsm
+++ b/toolkit/crashreporter/test/CrashTestUtils.jsm
@@ -17,18 +17,19 @@ let CrashTestUtils = {
 
   // Constants for dumpHasStream()
   // From google_breakpad/common/minidump_format.h
   MD_THREAD_LIST_STREAM:       3,
   MD_MEMORY_INFO_LIST_STREAM:  16
 };
 
 // Grab APIs from the testcrasher shared library
+Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/ctypes.jsm");
-let dir = __LOCATION__.parent;
+let dir = Services.dirsvc.get("CurWorkD", Components.interfaces.nsILocalFile);
 let file = dir.clone();
 file.append(ctypes.libraryName("testcrasher"));
 let lib = ctypes.open(file.path);
 CrashTestUtils.crash = lib.declare("Crash",
                                    ctypes.default_abi,
                                    ctypes.void_t,
                                    ctypes.int16_t);
 CrashTestUtils.saveAppMemory = lib.declare("SaveAppMemory",
--- a/toolkit/crashreporter/test/unit/xpcshell.ini
+++ b/toolkit/crashreporter/test/unit/xpcshell.ini
@@ -1,14 +1,16 @@
 [DEFAULT]
 head = head_crashreporter.js
 tail = 
 
 [test_crash_moz_crash.js]
 [test_crash_purevirtual.js]
 [test_crash_runtimeabort.js]
 [test_crash_oom.js]
+skip-if = os == 'win' && debug
+
 [test_crashreporter.js]
 [test_crashreporter_crash.js]
 [test_crashreporter_crash_profile_lock.js]
 
 [test_crashreporter_appmem.js]
 run-if = os == 'win' || os == 'linux'