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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 402283002: Modify TraceEventTestFixture.TraceBufferVectorReportFull to assert the overflowed_at_ts is between … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_unittest.cc
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index e084d7d521778466f24af53ee63abca4d2ed6017..3f41706e49e478f1205107bdaa15cfebb0d427b4 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -2450,16 +2450,17 @@ TEST_F(TraceEventTestFixture, TraceBufferVectorReportFull) {
trace_log->buffer_limit_reached_timestamp_.ToInternalValue()),
buffer_limit_reached_timestamp);
- // Test that buffer_limit_reached_timestamp's value is near to the timestamp
- // of the last trace event.
+ // Test that buffer_limit_reached_timestamp's value is between the timestamp
+ // of the last trace event and current time.
DropTracedMetadataRecords();
const DictionaryValue* last_trace_event = NULL;
double last_trace_event_timestamp = 0;
EXPECT_TRUE(trace_parsed_.GetDictionary(trace_parsed_.GetSize() - 1,
&last_trace_event));
EXPECT_TRUE(last_trace_event->GetDouble("ts", &last_trace_event_timestamp));
- // The difference between the two timestamps should be less than 50ms.
- EXPECT_NEAR(last_trace_event_timestamp, buffer_limit_reached_timestamp, 50);
+ EXPECT_LT(last_trace_event_timestamp, buffer_limit_reached_timestamp);
+ EXPECT_LT(buffer_limit_reached_timestamp,
+ trace_log->OffsetNow().ToInternalValue());
cpu_(ooo_6.6-7.5) 2014/07/24 22:58:18 I think this should be EXPECT_LE See the failure
}
TEST_F(TraceEventTestFixture, TraceBufferRingBufferGetReturnChunk) {
« 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