OLD | NEW |
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 | 4 |
5 library isolate_class_test; | 5 library isolate_class_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'test_helper.dart'; | 8 import 'test_helper.dart'; |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 super('http://127.0.0.1:$port/$id/'); | 40 super('http://127.0.0.1:$port/$id/'); |
41 | 41 |
42 String _libId; | 42 String _libId; |
43 onRequestCompleted(Map reply) { | 43 onRequestCompleted(Map reply) { |
44 Expect.equals('Isolate', reply['type']); | 44 Expect.equals('Isolate', reply['type']); |
45 Expect.equals('isolate_stacktrace_command_script', reply['rootLib']['name'])
; | 45 Expect.equals('isolate_stacktrace_command_script', reply['rootLib']['name'])
; |
46 _libId = reply['rootLib']['id']; | 46 _libId = reply['rootLib']['id']; |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 class IsolateListTest extends VmServiceRequestHelper { | 50 class VMTest extends VmServiceRequestHelper { |
51 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 51 VMTest(port) : super('http://127.0.0.1:$port/vm'); |
52 | 52 |
53 String _isolateId; | 53 String _isolateId; |
54 onRequestCompleted(Map reply) { | 54 onRequestCompleted(Map reply) { |
55 IsolateListTester tester = new IsolateListTester(reply); | 55 VMTester tester = new VMTester(reply); |
56 tester.checkIsolateCount(2); | 56 tester.checkIsolateCount(2); |
57 // TODO(turnidge): Fragile. Relies on isolate order in response. | 57 // TODO(turnidge): Fragile. Relies on isolate order in response. |
58 _isolateId = tester.getIsolateId(1); | 58 _isolateId = tester.getIsolateId(1); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 main() { | 62 main() { |
63 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); | 63 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); |
64 process.launch().then((port) { | 64 process.launch().then((port) { |
65 var test = new IsolateListTest(port); | 65 var test = new VMTest(port); |
66 test.makeRequest().then((_) { | 66 test.makeRequest().then((_) { |
67 var isolateSummaryTest = | 67 var isolateSummaryTest = |
68 new IsolateSummaryTest(port, test._isolateId); | 68 new IsolateSummaryTest(port, test._isolateId); |
69 isolateSummaryTest.makeRequest().then((_) { | 69 isolateSummaryTest.makeRequest().then((_) { |
70 var libraryTest = new LibraryTest(port, test._isolateId, | 70 var libraryTest = new LibraryTest(port, test._isolateId, |
71 isolateSummaryTest._libId); | 71 isolateSummaryTest._libId); |
72 libraryTest.makeRequest().then((_) { | 72 libraryTest.makeRequest().then((_) { |
73 var classTest = new ClassTest(port, test._isolateId, | 73 var classTest = new ClassTest(port, test._isolateId, |
74 libraryTest._classId); | 74 libraryTest._classId); |
75 classTest.makeRequest().then((_) { | 75 classTest.makeRequest().then((_) { |
76 process.requestExit(); | 76 process.requestExit(); |
77 }); | 77 }); |
78 }); | 78 }); |
79 }); | 79 }); |
80 }); | 80 }); |
81 }); | 81 }); |
82 } | 82 } |
OLD | NEW |