| 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_bad_library_test; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 import 'test_helper.dart'; | |
| 9 import 'package:expect/expect.dart'; | |
| 10 | |
| 11 class NullCollectionTest extends VmServiceRequestHelper { | |
| 12 NullCollectionTest(port, id, collection) : | |
| 13 super('http://127.0.0.1:$port/isolates/$id/$collection/-100'); | |
| 14 | |
| 15 onRequestCompleted(Map reply) { | |
| 16 Expect.equals('null', reply['type']); | |
| 17 } | |
| 18 } | |
| 19 | |
| 20 class BadCollectionTest extends VmServiceRequestHelper { | |
| 21 BadCollectionTest(port, id, collection) : | |
| 22 super('http://127.0.0.1:$port/isolates/$id/$collection'); | |
| 23 | |
| 24 onRequestCompleted(Map reply) { | |
| 25 Expect.equals('error', reply['type']); | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 class IsolateListTest extends VmServiceRequestHelper { | |
| 30 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | |
| 31 | |
| 32 int _isolateId; | |
| 33 onRequestCompleted(Map reply) { | |
| 34 IsolateListTester tester = new IsolateListTester(reply); | |
| 35 tester.checkIsolateCount(1); | |
| 36 tester.checkIsolateNameContains('unknown_isolate_command_script.dart'); | |
| 37 _isolateId = reply['members'][0]['id']; | |
| 38 } | |
| 39 } | |
| 40 | |
| 41 main() { | |
| 42 var process = new TestLauncher('unknown_isolate_command_script.dart'); | |
| 43 process.launch().then((port) { | |
| 44 var test = new IsolateListTest(port); | |
| 45 test.makeRequest().then((_) { | |
| 46 var nullCollectionRequest = | |
| 47 new NullCollectionTest(port, test._isolateId, | |
| 48 'libraries').makeRequest(); | |
| 49 var requests = Future.wait([nullCollectionRequest]); | |
| 50 requests.then((_) { | |
| 51 process.requestExit(); | |
| 52 }); | |
| 53 }); | |
| 54 }); | |
| 55 } | |
| OLD | NEW |