Bug 1402519 - Remove MOZ_CRASHREPORTER directives from testing; r?ted.mielczarek
MozReview-Commit-ID: 3QJI8o9f9UW
--- 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.