| 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_code_test; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 import 'test_helper.dart'; | |
| 9 import 'package:expect/expect.dart'; | |
| 10 | |
| 11 class ExpiredCollectionTest extends VmServiceRequestHelper { | |
| 12 ExpiredCollectionTest(port, id) : | |
| 13 super('http://127.0.0.1:$port/$id/objects/50'); | |
| 14 | |
| 15 onRequestCompleted(Map reply) { | |
| 16 Expect.equals('Sentinel', reply['type']); | |
| 17 Expect.equals('<expired>', reply['valueAsString']); | |
| 18 } | |
| 19 } | |
| 20 | |
| 21 class BadCollectionTest extends VmServiceRequestHelper { | |
| 22 BadCollectionTest(port, id) : | |
| 23 super('http://127.0.0.1:$port/$id/objects'); | |
| 24 | |
| 25 onRequestCompleted(Map reply) { | |
| 26 Expect.equals('Error', reply['type']); | |
| 27 } | |
| 28 } | |
| 29 | |
| 30 class VMTest extends VmServiceRequestHelper { | |
| 31 VMTest(port) : super('http://127.0.0.1:$port/vm'); | |
| 32 | |
| 33 String _isolateId; | |
| 34 onRequestCompleted(Map reply) { | |
| 35 VMTester tester = new VMTester(reply); | |
| 36 tester.checkIsolateCount(1); | |
| 37 _isolateId = tester.getIsolateId(0); | |
| 38 } | |
| 39 } | |
| 40 | |
| 41 main() { | |
| 42 var process = new TestLauncher('unknown_isolate_command_script.dart'); | |
| 43 process.launch().then((port) { | |
| 44 var test = new VMTest(port); | |
| 45 test.makeRequest().then((_) { | |
| 46 var badCollectionRequest = | |
| 47 new BadCollectionTest(port, test._isolateId).makeRequest(); | |
| 48 var expiredCollectionRequest = | |
| 49 new ExpiredCollectionTest(port, test._isolateId).makeRequest(); | |
| 50 var requests = Future.wait([badCollectionRequest, | |
| 51 expiredCollectionRequest]); | |
| 52 requests.then((_) { | |
| 53 process.requestExit(); | |
| 54 }); | |
| 55 }); | |
| 56 }); | |
| 57 } | |
| OLD | NEW |