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

Unified Diff: runtime/observatory/tests/service/get_vm_timeline_rpc_test.dart

Issue 1406413006: Timeline service protocol support with Observatory UI (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/observatory/run.sh ('k') | runtime/observatory/web/third_party/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/get_vm_timeline_rpc_test.dart
diff --git a/runtime/observatory/tests/service/get_vm_timeline_rpc_test.dart b/runtime/observatory/tests/service/get_vm_timeline_rpc_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0ab482576912c4caaee94840c45c9e4054918e7d
--- /dev/null
+++ b/runtime/observatory/tests/service/get_vm_timeline_rpc_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override --complete_timeline
+
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+primeTimeline() {
+ Timeline.startSync('apple');
+ Timeline.finishSync();
+}
+
+List<Map> filterForDartEvents(List<Map> events) {
+ return events.where((event) => event['cat'] == 'Dart').toList();
+}
+
+var tests = [
+ (VM vm) async {
+ Map result = await vm.invokeRpcNoUpgrade('_getVMTimeline', {});
+ expect(result['type'], equals('_Timeline'));
+ expect(result['traceEvents'], new isInstanceOf<List>());
+ List<Map> dartEvents = filterForDartEvents(result['traceEvents']);
+ expect(dartEvents.length, equals(1));
+ Map dartEvent = dartEvents[0];
+ expect(dartEvent['name'], equals('apple'));
+ },
+];
+
+main(args) async => runVMTests(args, tests, testeeBefore: primeTimeline);
« no previous file with comments | « runtime/observatory/run.sh ('k') | runtime/observatory/web/third_party/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698