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

Unified Diff: runtime/vm/timeline_test.cc

Issue 1411783004: More timeline cleanups (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « runtime/vm/timeline_analysis.cc ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « runtime/vm/timeline_analysis.cc ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698