| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library isolate_library_test; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 import 'test_helper.dart'; | |
| 9 import 'package:expect/expect.dart'; | |
| 10 | |
| 11 class LibraryTest extends VmServiceRequestHelper { | |
| 12 LibraryTest(port, id, libId) : | |
| 13 super('http://127.0.0.1:$port/$id/$libId'); | |
| 14 | |
| 15 onRequestCompleted(Map reply) { | |
| 16 Expect.equals('Library', reply['type']); | |
| 17 Expect.equals('isolate_stacktrace_command_script', reply['name']); | |
| 18 } | |
| 19 } | |
| 20 | |
| 21 class IsolateSummaryTest extends VmServiceRequestHelper { | |
| 22 IsolateSummaryTest(port, id) : | |
| 23 super('http://127.0.0.1:$port/$id/'); | |
| 24 | |
| 25 String _libId; | |
| 26 onRequestCompleted(Map reply) { | |
| 27 Expect.equals('Isolate', reply['type']); | |
| 28 Expect.equals('isolate_stacktrace_command_script', reply['rootLib']['name'])
; | |
| 29 _libId = reply['rootLib']['id']; | |
| 30 } | |
| 31 } | |
| 32 | |
| 33 class VMTest extends VmServiceRequestHelper { | |
| 34 VMTest(port) : super('http://127.0.0.1:$port/vm'); | |
| 35 | |
| 36 String _isolateId; | |
| 37 onRequestCompleted(Map reply) { | |
| 38 VMTester tester = new VMTester(reply); | |
| 39 tester.checkIsolateCount(2); | |
| 40 // TODO(turnidge): Fragile. Relies on isolate order in response. | |
| 41 _isolateId = tester.getIsolateId(1); | |
| 42 } | |
| 43 } | |
| 44 | |
| 45 main() { | |
| 46 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); | |
| 47 process.launch().then((port) { | |
| 48 var test = new VMTest(port); | |
| 49 test.makeRequest().then((_) { | |
| 50 var isolateSummaryTest = | |
| 51 new IsolateSummaryTest(port, test._isolateId); | |
| 52 isolateSummaryTest.makeRequest().then((_) { | |
| 53 var libraryTest = new LibraryTest(port, test._isolateId, | |
| 54 isolateSummaryTest._libId); | |
| 55 libraryTest.makeRequest().then((_) { | |
| 56 process.requestExit(); | |
| 57 }); | |
| 58 }); | |
| 59 }); | |
| 60 }); | |
| 61 } | |
| OLD | NEW |