| 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 28 matching lines...) Expand all Loading... |
| 39 onRequestCompleted(Map reply) { | 39 onRequestCompleted(Map reply) { |
| 40 Expect.equals('StackTrace', reply['type']); | 40 Expect.equals('StackTrace', reply['type']); |
| 41 List members = reply['members']; | 41 List members = reply['members']; |
| 42 Expect.equals('a', members[0]['function']['name']); | 42 Expect.equals('a', members[0]['function']['name']); |
| 43 _aId = members[0]['code']['id']; | 43 _aId = members[0]['code']['id']; |
| 44 Expect.equals('c', members[2]['function']['name']); | 44 Expect.equals('c', members[2]['function']['name']); |
| 45 _cId = members[2]['code']['id']; | 45 _cId = members[2]['code']['id']; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 class IsolateListTest extends VmServiceRequestHelper { | 49 class VMTest extends VmServiceRequestHelper { |
| 50 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 50 VMTest(port) : super('http://127.0.0.1:$port/vm'); |
| 51 | 51 |
| 52 String _isolateId; | 52 String _isolateId; |
| 53 onRequestCompleted(Map reply) { | 53 onRequestCompleted(Map reply) { |
| 54 IsolateListTester tester = new IsolateListTester(reply); | 54 VMTester tester = new VMTester(reply); |
| 55 tester.checkIsolateCount(2); | 55 tester.checkIsolateCount(2); |
| 56 // TODO(turnidge): Fragile. Relies on isolate order in response. | 56 // TODO(turnidge): Fragile. Relies on isolate order in response. |
| 57 _isolateId = tester.getIsolateId(1); | 57 _isolateId = tester.getIsolateId(0); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 main() { | 61 main() { |
| 62 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); | 62 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); |
| 63 process.launch().then((port) { | 63 process.launch().then((port) { |
| 64 var test = new IsolateListTest(port); | 64 var test = new VMTest(port); |
| 65 test.makeRequest().then((_) { | 65 test.makeRequest().then((_) { |
| 66 var stackTraceTest = | 66 var stackTraceTest = |
| 67 new StackTraceTest(port, test._isolateId); | 67 new StackTraceTest(port, test._isolateId); |
| 68 stackTraceTest.makeRequest().then((_) { | 68 stackTraceTest.makeRequest().then((_) { |
| 69 var codeATest = new CodeATest(port, test._isolateId, | 69 var codeATest = new CodeATest(port, test._isolateId, |
| 70 stackTraceTest._aId); | 70 stackTraceTest._aId); |
| 71 var codeCTest = new CodeCTest(port, test._isolateId, | 71 var codeCTest = new CodeCTest(port, test._isolateId, |
| 72 stackTraceTest._cId); | 72 stackTraceTest._cId); |
| 73 var requests = Future.wait([codeATest.makeRequest(), | 73 var requests = Future.wait([codeATest.makeRequest(), |
| 74 codeCTest.makeRequest()]); | 74 codeCTest.makeRequest()]); |
| 75 requests.then((_) { | 75 requests.then((_) { |
| 76 process.requestExit(); | 76 process.requestExit(); |
| 77 }); | 77 }); |
| 78 }); | 78 }); |
| 79 }); | 79 }); |
| 80 }); | 80 }); |
| 81 } | 81 } |
| OLD | NEW |