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

Side by Side Diff: runtime/observatory/tests/service/get_cpu_profile_timeline_rpc_test.dart

Issue 1535513002: Fix get_cpu_profile_timeline_rpc_test. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | runtime/vm/service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 8
9 import 'test_helper.dart'; 9 import 'test_helper.dart';
10 10
(...skipping 13 matching lines...) Expand all
24 (Isolate isolate) async { 24 (Isolate isolate) async {
25 var params = { 25 var params = {
26 'tags': 'VMUser' 26 'tags': 'VMUser'
27 }; 27 };
28 var result = await isolate.invokeRpcNoUpgrade( 28 var result = await isolate.invokeRpcNoUpgrade(
29 '_getCpuProfileTimeline', params); 29 '_getCpuProfileTimeline', params);
30 print(result); 30 print(result);
31 expect(result['type'], equals('_CpuProfileTimeline')); 31 expect(result['type'], equals('_CpuProfileTimeline'));
32 32
33 var isString = new isInstanceOf<String>(); 33 var isString = new isInstanceOf<String>();
34 var isInt = new isInstanceOf<int>();
34 35
35 Map frames = result['stackFrames']; 36 Map frames = result['stackFrames'];
36 for (Map frame in frames.values) { 37 for (Map frame in frames.values) {
37 expect(frame['category'], isString); 38 expect(frame['category'], isString);
38 expect(frame['name'], isString); 39 expect(frame['name'], isString);
39 if (frame['parent'] != null) { 40 if (frame['parent'] != null) {
40 expect(frames.containsKey(frame['parent']), isTrue); 41 expect(frames.containsKey(frame['parent']), isTrue);
41 } 42 }
42 } 43 }
43 44
44 List events = result['traceEvents']; 45 List events = result['traceEvents'];
45 for (Map event in events) { 46 for (Map event in events) {
46 expect(event['ph'], equals('P')); 47 expect(event['ph'], equals('P'));
47 expect(event['pid'], isString); 48 expect(event['pid'], isInt);
48 expect(event['tid'], isString); 49 expect(event['tid'], isInt);
49 expect(event['ts'], isString); 50 expect(event['ts'], isInt);
50 expect(event['category'], equals("Dart")); 51 expect(event['category'], equals("Dart"));
51 expect(frames.containsKey(event['sf']), isTrue); 52 expect(frames.containsKey(event['sf']), isTrue);
52 } 53 }
53 }, 54 },
54 ]; 55 ];
55 56
56 main(args) async => runIsolateTests(args, tests, testeeBefore: testeeDo); 57 main(args) async => runIsolateTests(args, tests, testeeBefore: testeeDo);
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698