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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 1294023009: Switch to a VM wide timeline recorder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 668e6553d93e2a2fc13c31cf36f157107bf77d8a..8ea81a97c7c1f2d24945b1b3951c8b290a78109d 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -9279,9 +9279,10 @@ TEST_CASE(Timeline_Dart_TimelineDuration) {
// Add a duration event.
Dart_TimelineDuration("testDurationEvent", 0, 1);
// Check that it is in the output.
- TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+ TimelineEventRecorder* recorder = Timeline::recorder();
JSONStream js;
- recorder->PrintJSON(&js);
+ IsolateTimelineEventFilter filter(isolate);
+ recorder->PrintJSON(&js, &filter);
EXPECT_SUBSTRING("testDurationEvent", js.ToCString());
}
@@ -9294,9 +9295,10 @@ TEST_CASE(Timeline_Dart_TimelineInstant) {
stream->set_enabled(true);
Dart_TimelineInstant("testInstantEvent");
// Check that it is in the output.
- TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+ TimelineEventRecorder* recorder = Timeline::recorder();
JSONStream js;
- recorder->PrintJSON(&js);
+ IsolateTimelineEventFilter filter(isolate);
+ recorder->PrintJSON(&js, &filter);
EXPECT_SUBSTRING("testInstantEvent", js.ToCString());
}
@@ -9314,9 +9316,10 @@ TEST_CASE(Timeline_Dart_TimelineAsyncDisabled) {
// Call Dart_TimelineAsyncEnd with a negative async_id.
Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
// Check that testAsync is not in the output.
- TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+ TimelineEventRecorder* recorder = Timeline::recorder();
JSONStream js;
- recorder->PrintJSON(&js);
+ TimelineEventFilter filter;
+ recorder->PrintJSON(&js, &filter);
EXPECT_NOTSUBSTRING("testAsyncEvent", js.ToCString());
}
@@ -9335,9 +9338,10 @@ TEST_CASE(Timeline_Dart_TimelineAsync) {
Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
// Check that it is in the output.
- TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+ TimelineEventRecorder* recorder = Timeline::recorder();
JSONStream js;
- recorder->PrintJSON(&js);
+ IsolateTimelineEventFilter filter(isolate);
+ recorder->PrintJSON(&js, &filter);
EXPECT_SUBSTRING("testAsyncEvent", js.ToCString());
}
@@ -9411,7 +9415,7 @@ TEST_CASE(Timeline_Dart_TimelineGetTrace) {
// Heartbeat test.
EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
- EXPECT_SUBSTRING("\"function\":\"main\"", buffer);
+ EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
// Free buffer allocated by AppendStreamConsumer
free(data.buffer);
« runtime/vm/dart.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698