Index: runtime/vm/timeline_test.cc |
diff --git a/runtime/vm/timeline_test.cc b/runtime/vm/timeline_test.cc |
index 17fea5d44e753f06b8bc12f966f5b187e11b1dff..00fc839045c09d57b3e3f4f19a891a8ccf1dda6b 100644 |
--- a/runtime/vm/timeline_test.cc |
+++ b/runtime/vm/timeline_test.cc |
@@ -51,6 +51,11 @@ class TimelineTestHelper : public AllStatic { |
} |
} |
+ static void SetBlockThread(TimelineEventBlock* block, |
+ intptr_t ftid) { |
+ block->thread_id_ = OSThread::ThreadIdFromIntPtr(ftid); |
+ } |
+ |
static void FakeDuration( |
TimelineEventRecorder* recorder, |
const char* label, |
@@ -242,10 +247,6 @@ class EventCounterRecorder : public TimelineEventStreamingRecorder { |
counts_[event->event_type()]++; |
} |
- void StreamDartEvent(const char* event) { |
- // NOOP. |
- } |
- |
intptr_t CountFor(TimelineEvent::EventType type) { |
return counts_[type]; |
} |
@@ -324,12 +325,17 @@ TEST_CASE(TimelineAnalysis_ThreadBlockCount) { |
ASSERT(recorder != NULL); |
// Blocks owned by thread "1". |
TimelineEventBlock* block_1_0 = recorder->GetNewBlock(); |
+ TimelineTestHelper::SetBlockThread(block_1_0, 1); |
TimelineEventBlock* block_1_1 = recorder->GetNewBlock(); |
+ TimelineTestHelper::SetBlockThread(block_1_1, 1); |
TimelineEventBlock* block_1_2 = recorder->GetNewBlock(); |
+ TimelineTestHelper::SetBlockThread(block_1_2, 1); |
// Blocks owned by thread "2". |
TimelineEventBlock* block_2_0 = recorder->GetNewBlock(); |
+ TimelineTestHelper::SetBlockThread(block_2_0, 2); |
// Blocks owned by thread "3". |
TimelineEventBlock* block_3_0 = recorder->GetNewBlock(); |
+ TimelineTestHelper::SetBlockThread(block_3_0, 3); |
USE(block_3_0); |
// Add events to each block for thread 1. |
@@ -358,6 +364,7 @@ TEST_CASE(TimelineAnalysis_ThreadBlockCount) { |
// Discover threads in recorder. |
TimelineAnalysis ta(zone, isolate, recorder); |
ta.BuildThreads(); |
+ EXPECT(!ta.has_error()); |
// block_3_0 is never used by a thread, so we only have two threads. |
EXPECT_EQ(2, ta.NumThreads()); |