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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 1848683002: Remove redundant timeline API (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b94ff3b185e8b0963f59696b5205a9e2b42a947e..2bda3205765245de180e0814cb5f0ba69d1a73b3 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -9195,7 +9195,11 @@ TEST_CASE(Timeline_Dart_TimelineDuration) {
// Make sure it is enabled.
stream->set_enabled(true);
// Add a duration event.
- Dart_TimelineDuration("testDurationEvent", 0, 1);
+ Dart_TimelineEvent("testDurationEvent",
+ 0,
+ 1,
+ Dart_Timeline_Event_Duration,
+ 0, NULL, NULL);
// Check that it is in the output.
TimelineEventRecorder* recorder = Timeline::recorder();
Timeline::ReclaimCachedBlocksFromThreads();
@@ -9212,7 +9216,11 @@ TEST_CASE(Timeline_Dart_TimelineInstant) {
TimelineStream* stream = Timeline::GetEmbedderStream();
// Make sure it is enabled.
stream->set_enabled(true);
- Dart_TimelineInstant("testInstantEvent");
+ Dart_TimelineEvent("testInstantEvent",
+ 0,
+ 1,
+ Dart_Timeline_Event_Instant,
+ 0, NULL, NULL);
// Check that it is in the output.
TimelineEventRecorder* recorder = Timeline::recorder();
Timeline::ReclaimCachedBlocksFromThreads();
@@ -9228,12 +9236,12 @@ TEST_CASE(Timeline_Dart_TimelineAsyncDisabled) {
TimelineStream* stream = Timeline::GetEmbedderStream();
// Make sure it is disabled.
stream->set_enabled(false);
- int64_t async_id = -1;
- Dart_TimelineAsyncBegin("testAsyncEvent", &async_id);
- // Expect that the |async_id| is negative because the stream is disabled.
- EXPECT(async_id < 0);
- // Call Dart_TimelineAsyncEnd with a negative async_id.
- Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
+ int64_t async_id = 99;
+ Dart_TimelineEvent("testAsyncEvent",
+ 0,
+ async_id,
+ Dart_Timeline_Event_Async_Begin,
+ 0, NULL, NULL);
// Check that testAsync is not in the output.
TimelineEventRecorder* recorder = Timeline::recorder();
Timeline::ReclaimCachedBlocksFromThreads();
@@ -9250,12 +9258,12 @@ TEST_CASE(Timeline_Dart_TimelineAsync) {
TimelineStream* stream = Timeline::GetEmbedderStream();
// Make sure it is enabled.
stream->set_enabled(true);
- int64_t async_id = -1;
- Dart_TimelineAsyncBegin("testAsyncEvent", &async_id);
- // Expect that the |async_id| is >= 0.
- EXPECT(async_id >= 0);
-
- Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
+ int64_t async_id = 99;
+ Dart_TimelineEvent("testAsyncEvent",
+ 0,
+ async_id,
+ Dart_Timeline_Event_Async_Begin,
+ 0, NULL, NULL);
// Check that it is in the output.
TimelineEventRecorder* recorder = Timeline::recorder();
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698