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) |
} |
} |