Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: base/debug/crash_logging_unittest.cc

Issue 1368703002: Use a class instead of several separate globals in crash_logging.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/crash_logging.cc ('k') | chrome/common/crash_keys_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/crash_logging_unittest.cc
diff --git a/base/debug/crash_logging_unittest.cc b/base/debug/crash_logging_unittest.cc
index 4cd9f3e3b09f5a476bdd0d0f412371b54e31ce0e..aec0fbd87d6ec3002be74643d1696fafdb213449 100644
--- a/base/debug/crash_logging_unittest.cc
+++ b/base/debug/crash_logging_unittest.cc
@@ -7,12 +7,13 @@
#include <map>
#include <string>
+#include "base/at_exit.h"
#include "base/bind.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
-std::map<std::string, std::string>* key_values_ = NULL;
+std::map<std::string, std::string>* key_values_ = nullptr;
} // namespace
@@ -26,10 +27,8 @@ class CrashLoggingTest : public testing::Test {
}
void TearDown() override {
- base::debug::ResetCrashLoggingForTesting();
-
delete key_values_;
- key_values_ = NULL;
+ key_values_ = nullptr;
}
private:
@@ -41,6 +40,10 @@ class CrashLoggingTest : public testing::Test {
static void ClearKeyValue(const base::StringPiece& key) {
key_values_->erase(key.as_string());
}
+
+ // The ShadowingAtExitManager will destroy the singleton used to store crash
+ // key data upon destruction.
+ base::ShadowingAtExitManager at_exit_manager_;
};
TEST_F(CrashLoggingTest, SetClearSingle) {
« no previous file with comments | « base/debug/crash_logging.cc ('k') | chrome/common/crash_keys_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698