OLD | NEW |
---|---|
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 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:developer'; | 7 import 'dart:developer'; |
8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
9 import 'package:observatory/service_io.dart'; | 9 import 'package:observatory/service_io.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 var all = await isolate.invokeRpcNoUpgrade('__getProcesses', {}); | 87 var all = await isolate.invokeRpcNoUpgrade('__getProcesses', {}); |
88 expect(all['type'], equals('_startedprocesses')); | 88 expect(all['type'], equals('_startedprocesses')); |
89 | 89 |
90 expect(all['data'].length, equals(3)); | 90 expect(all['data'].length, equals(3)); |
91 | 91 |
92 var first = await isolate.invokeRpcNoUpgrade( | 92 var first = await isolate.invokeRpcNoUpgrade( |
93 '__getProcessById', { 'id' : all['data'][0]['id'] }); | 93 '__getProcessById', { 'id' : all['data'][0]['id'] }); |
94 expect(first['name'], io.Platform.executable); | 94 expect(first['name'], io.Platform.executable); |
95 expect(first['pid'], equals(setup['pids'][0])); | 95 expect(first['pid'], equals(setup['pids'][0])); |
96 expect(first['arguments'].contains('foobar'), isFalse); | 96 expect(first['arguments'].contains('foobar'), isFalse); |
97 expect(first['started_at'], greaterThan(0)); | |
Cutch
2015/09/14 14:23:32
DBC- these field names should be dartCamelCase
ricow1
2015/09/14 15:57:45
haha, I actually tried to be consistent and used u
| |
97 | 98 |
98 var second = await isolate.invokeRpcNoUpgrade( | 99 var second = await isolate.invokeRpcNoUpgrade( |
99 '__getProcessById', { 'id' : all['data'][1]['id'] }); | 100 '__getProcessById', { 'id' : all['data'][1]['id'] }); |
100 expect(second['name'], io.Platform.executable); | 101 expect(second['name'], io.Platform.executable); |
101 expect(second['pid'], equals(setup['pids'][1])); | 102 expect(second['pid'], equals(setup['pids'][1])); |
102 expect(second['arguments'].contains('foobar'), isTrue); | 103 expect(second['arguments'].contains('foobar'), isTrue); |
103 expect(second['pid'] != first['pid'], isTrue); | 104 expect(second['pid'] != first['pid'], isTrue); |
105 expect(second['started_at'], greaterThan(0)); | |
106 expect(second['started_at'], greaterThanOrEqualTo(first['started_at'])); | |
104 | 107 |
105 var third = await isolate.invokeRpcNoUpgrade( | 108 var third = await isolate.invokeRpcNoUpgrade( |
106 '__getProcessById', { 'id' : all['data'][2]['id'] }); | 109 '__getProcessById', { 'id' : all['data'][2]['id'] }); |
107 expect(third['name'], io.Platform.executable); | 110 expect(third['name'], io.Platform.executable); |
108 expect(third['pid'], equals(setup['pids'][2])); | 111 expect(third['pid'], equals(setup['pids'][2])); |
109 expect(third['pid'] != first['pid'], isTrue); | 112 expect(third['pid'] != first['pid'], isTrue); |
110 expect(third['pid'] != second['pid'], isTrue); | 113 expect(third['pid'] != second['pid'], isTrue); |
114 expect(third['started_at'], greaterThanOrEqualTo(second['started_at'])); | |
111 | 115 |
112 await isolate.invokeRpcNoUpgrade('__closeStdin', {}); | 116 await isolate.invokeRpcNoUpgrade('__closeStdin', {}); |
113 all = await isolate.invokeRpcNoUpgrade('__getProcesses', {}); | 117 all = await isolate.invokeRpcNoUpgrade('__getProcesses', {}); |
114 expect(all['type'], equals('_startedprocesses')); | 118 expect(all['type'], equals('_startedprocesses')); |
115 expect(all['data'].length, equals(2)); | 119 expect(all['data'].length, equals(2)); |
116 } finally { | 120 } finally { |
117 await isolate.invokeRpcNoUpgrade('__cleanup', {}); | 121 await isolate.invokeRpcNoUpgrade('__cleanup', {}); |
118 } | 122 } |
119 }, | 123 }, |
120 ]; | 124 ]; |
121 | 125 |
122 main(args) async => runIsolateTests(args, processTests, | 126 main(args) async => runIsolateTests(args, processTests, |
123 testeeBefore:setupProcesses); | 127 testeeBefore:setupProcesses); |
OLD | NEW |