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

Unified Diff: base/test_suite.h

Issue 113824: Do not monitor system power state during unit tests. (Closed)
Patch Set: Created 11 years, 7 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/time.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test_suite.h
diff --git a/base/test_suite.h b/base/test_suite.h
index 79fe5cf38dd03c54aa2fe8ccabf4894e1bf35d43..b30c9a62840f01d863574087a977eb240529f1ac 100644
--- a/base/test_suite.h
+++ b/base/test_suite.h
@@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/multiprocess_test.h"
#include "base/scoped_nsautorelease_pool.h"
+#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
@@ -108,6 +109,10 @@ class TestSuite {
logging::SetLogItems(true, true, true, true);
#if defined(OS_WIN)
+ // We don't want to use SystemMonitor power state monitoring in tests,
+ // so enable high resolution timer unconditionally.
+ base::Time::EnableHiResClockForTests();
Mike Belshe 2009/05/26 15:41:20 I think this comment will lose value over time bec
+
// In some cases, we do not want to see standard error dialogs.
if (!IsDebuggerPresent() &&
!CommandLine::ForCurrentProcess()->HasSwitch(L"show-error-dialogs")) {
@@ -116,9 +121,9 @@ class TestSuite {
// When the code in this file moved around, bug 6436 resurfaced.
// As a hack workaround, just #ifdef out this code for Purify builds.
logging::SetLogAssertHandler(UnitTestAssertHandler);
-#endif
+#endif // !defined(PURIFY)
}
-#endif
+#endif // defined(OS_WIN)
icu_util::Initialize();
}
« no previous file with comments | « no previous file | base/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698