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

Unified Diff: base/memory/singleton.h

Issue 8947021: Destroy all Singletons and LazyInstances between each test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resurrect() Created 7 years, 5 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 | « no previous file | base/test/test_suite.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/singleton.h
diff --git a/base/memory/singleton.h b/base/memory/singleton.h
index 0d4fc8990c443f3b025c37a5937bf232ca4ac14d..28fda3d22e4b86589aa036efae500bfea200e675 100644
--- a/base/memory/singleton.h
+++ b/base/memory/singleton.h
@@ -116,6 +116,12 @@ struct StaticMemorySingletonTraits {
static void Delete(Type* p) {
if (p != NULL)
p->Type::~Type();
+
+ // Only in unittests, automatically Resurrect() the singleton so that tests
+ // do not have to manually call it. See <http://crbug.com/258047>.
+#if defined(UNIT_TEST)
+ Resurrect();
+#endif
}
static const bool kRegisterAtExit = true;
« no previous file with comments | « no previous file | base/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698