Bug 1402519 - Remove MOZ_CRASHREPORTER directives from testing; r?ted.mielczarek draft
authorGabriele Svelto <gsvelto@mozilla.com>
Tue, 10 Oct 2017 15:22:56 +0200
changeset 688685 5128a58ded9c279b7d135ae9ab9818b6012e6772
parent 688684 fd320db922f9eddf426f17bb7c941176a48caa9f
child 688686 a827f4935a9f0143cf2feff79f77ec5a6bf4a4c9
push id86821
push usergsvelto@mozilla.com
push dateMon, 30 Oct 2017 14:19:43 +0000
reviewersted
bugs1402519
milestone58.0a1
Bug 1402519 - Remove MOZ_CRASHREPORTER directives from testing; r?ted.mielczarek MozReview-Commit-ID: 3QJI8o9f9UW
testing/gtest/mozilla/GTestRunner.cpp
--- a/testing/gtest/mozilla/GTestRunner.cpp
+++ b/testing/gtest/mozilla/GTestRunner.cpp
@@ -1,19 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * * This Source Code Form is subject to the terms of the Mozilla Public
  * * License, v. 2.0. If a copy of the MPL was not distributed with this
  * * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GTestRunner.h"
 #include "gtest/gtest.h"
 #include "mozilla/Attributes.h"
-#ifdef MOZ_CRASHREPORTER
 #include "nsICrashReporter.h"
-#endif
 #include "testing/TestHarness.h"
 #include "prenv.h"
 #ifdef XP_WIN
 #include "mozilla/ipc/WindowsMessageLoop.h"
 #endif
 
 using ::testing::EmptyTestEventListener;
 using ::testing::InitGoogleTest;
@@ -86,17 +84,16 @@ int RunGTestFunc(int* argc, char** argv)
 
   PR_SetEnv("XPCOM_DEBUG_BREAK=stack-and-abort");
 
   ScopedXPCOM xpcom("GTest");
 
 #ifdef XP_WIN
   mozilla::ipc::windows::InitUIThread();
 #endif
-#ifdef MOZ_CRASHREPORTER
   nsCOMPtr<nsICrashReporter> crashreporter;
   char *crashreporterStr = PR_GetEnv("MOZ_CRASHREPORTER");
   if (crashreporterStr && !strcmp(crashreporterStr, "1")) {
     //TODO: move this to an even-more-common location to use in all
     // C++ unittests
     crashreporter = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
     if (crashreporter) {
       std::cerr << "Setting up crash reporting" << std::endl;
@@ -107,17 +104,16 @@ int RunGTestFunc(int* argc, char** argv)
       nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR,
                        NS_GET_IID(nsIFile),
                        getter_AddRefs(cwd));
       MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
       crashreporter->SetEnabled(true);
       crashreporter->SetMinidumpPath(cwd);
     }
   }
-#endif
 
   return RUN_ALL_TESTS();
 }
 
 // We use a static var 'RunGTest' defined in nsAppRunner.cpp.
 // RunGTest is initialized to nullptr but if GTest (this file)
 // is linked in then RunGTest will be set here indicating
 // GTest is supported.