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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--error_on_bad_type --error_on_bad_override --complete_timeline
5
6 import 'dart:developer';
7 import 'package:observatory/service_io.dart';
8 import 'package:unittest/unittest.dart';
9
10 import 'test_helper.dart';
11
12 primeTimeline() {
13 Timeline.startSync('apple');
14 Timeline.finishSync();
15 }
16
17 List<Map> filterForDartEvents(List<Map> events) {
18 return events.where((event) => event['cat'] == 'Dart').toList();
19 }
20
21 var tests = [
22 (VM vm) async {
23 Map result = await vm.invokeRpcNoUpgrade('_getVMTimeline', {});
24 expect(result['type'], equals('_Timeline'));
25 expect(result['traceEvents'], new isInstanceOf<List>());
26 List<Map> dartEvents = filterForDartEvents(result['traceEvents']);
27 expect(dartEvents.length, equals(1));
28 Map dartEvent = dartEvents[0];
29 expect(dartEvent['name'], equals('apple'));
30 },
31 ];
32
33 main(args) async => runVMTests(args, tests, testeeBefore: primeTimeline);
OLDNEW
« 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