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

Unified Diff: base/test/trace_event_analyzer_unittest.cc

Issue 9057001: Update Sleep() calls in base/test to use TimeDelta instead of int. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make variable names style guide consistent. Created 8 years, 12 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/test/test_file_util_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/trace_event_analyzer_unittest.cc
diff --git a/base/test/trace_event_analyzer_unittest.cc b/base/test/trace_event_analyzer_unittest.cc
index 18cf4cbb368935b8ad9b31cc83edb188ad68a509..12d8e3248fbac10d912f16d9c06d2bfaaf10e97f 100644
--- a/base/test/trace_event_analyzer_unittest.cc
+++ b/base/test/trace_event_analyzer_unittest.cc
@@ -389,10 +389,10 @@ TEST_F(TraceEventAnalyzerTest, Duration) {
using namespace trace_analyzer;
ManualSetUp();
- int sleep_time_us = 200000;
+ const base::TimeDelta kSleepTime = base::TimeDelta::FromMilliseconds(200);
// We will search for events that have a duration of greater than 90% of the
// sleep time, so that there is no flakiness.
- int duration_cutoff_us = (sleep_time_us * 9) / 10;
+ int duration_cutoff_us = (kSleepTime.InMicroseconds() * 9) / 10;
BeginTracing();
{
@@ -401,7 +401,7 @@ TEST_F(TraceEventAnalyzerTest, Duration) {
{
TRACE_EVENT0("cat2", "name3"); // found by duration query
TRACE_EVENT_INSTANT0("noise", "name4"); // not searched for, just noise
- base::PlatformThread::Sleep(sleep_time_us / 1000);
+ base::PlatformThread::Sleep(kSleepTime);
TRACE_EVENT0("cat2", "name5"); // not found (duration too short)
}
}
« no previous file with comments | « base/test/test_file_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698