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

Unified Diff: webrtc/base/cpu_time_unittest.cc

Issue 2739673003: Fix CpuTimeTest to tolerate background test related threads (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/cpu_time_unittest.cc
diff --git a/webrtc/base/cpu_time_unittest.cc b/webrtc/base/cpu_time_unittest.cc
index 6a82cfdcbbc3fcc3cac125cf6332b90f9f1eb6ed..b6f6766dccac463b68d5e8e8c909fb42417ae93e 100644
--- a/webrtc/base/cpu_time_unittest.cc
+++ b/webrtc/base/cpu_time_unittest.cc
@@ -62,12 +62,12 @@ TEST(CpuTimeTest, TwoThreads) {
// Therefore GetThreadCpuTime is not a wall clock.
EXPECT_LE(thread_duration_nanos,
kAllowedErrorMillisecs * kNumNanosecsPerMillisec);
- // Total process time is twice working threads' CPU time.
+ // Total process time is at least twice working threads' CPU time.
// Therefore process and thread times are correctly related.
- EXPECT_NEAR(
+ EXPECT_GE(
process_duration_nanos,
- kWorkingThreads * kProcessingTimeMillisecs * kNumNanosecsPerMillisec,
- kWorkingThreads * kAllowedErrorMillisecs * kNumNanosecsPerMillisec);
+ kWorkingThreads * (kProcessingTimeMillisecs - kAllowedErrorMillisecs)
+ * kNumNanosecsPerMillisec);
}
TEST(CpuTimeTest, Sleeping) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698