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

Side by Side Diff: tests/standalone/vmservice/isolate_list_test.dart

Issue 19697016: Relax vmservice isolate tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/vmservice/multiple_isolate_list_test.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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=--short_socket_read 4 // VMOptions=--short_socket_read
5 // VMOptions=--short_socket_write 5 // VMOptions=--short_socket_write
6 // VMOptions=--short_socket_read --short_socket_write 6 // VMOptions=--short_socket_read --short_socket_write
7 // 7 //
8 // Test: 8 // Test:
9 // *) Connect to VM Service and obtain list of running isolates. 9 // *) Connect to VM Service and obtain list of running isolates.
10 10
11 library isolate_list_test; 11 library isolate_list_test;
12 12
13 import 'test_helper.dart'; 13 import 'test_helper.dart';
14 import 'package:expect/expect.dart'; 14 import 'package:expect/expect.dart';
15 15
16 16
17 class IsolateListTest extends VmServiceRequestHelper { 17 class IsolateListTest extends VmServiceRequestHelper {
18 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); 18 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates');
19 19
20 onRequestCompleted(Map reply) { 20 onRequestCompleted(Map reply) {
21 // The reply is an IsolateList. 21 IsolateListTester tester = new IsolateListTester(reply);
22 Expect.equals('IsolateList', reply['type']); 22 tester.checkIsolateCount(1);
23 // There is 1 running isolate. 23 tester.checkIsolateNameContains('isolate_list_script.dart');
24 Expect.equals(1, reply['members'].length);
25 // It's id is 7116.
26 Expect.equals(7116, reply['members'][0]['id']);
27 // It's this isolate.
28 Expect.isTrue(
29 reply['members'][0]['name'].startsWith('isolate_list_script.dart'));
30 } 24 }
31 } 25 }
32 26
33 27
34 main() { 28 main() {
35 var process = new TestLauncher('isolate_list_script.dart'); 29 var process = new TestLauncher('isolate_list_script.dart');
36 process.launch().then((port) { 30 process.launch().then((port) {
37 var test = new IsolateListTest(port); 31 var test = new IsolateListTest(port);
38 test.makeRequest().then((_) { 32 test.makeRequest().then((_) {
39 process.requestExit(); 33 process.requestExit();
40 }); 34 });
41 }); 35 });
42 } 36 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/vmservice/multiple_isolate_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698