Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: tests/standalone/vmservice/isolate_bad_object_test.dart

Issue 514833003: Add a new Sentinel type for sentinel responses. (They are not Null). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js, fix tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/service_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_bad_code_test; 5 library isolate_bad_code_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
11 class NullCollectionTest extends VmServiceRequestHelper { 11 class ExpiredCollectionTest extends VmServiceRequestHelper {
12 NullCollectionTest(port, id) : 12 ExpiredCollectionTest(port, id) :
13 super('http://127.0.0.1:$port/$id/objects/50'); 13 super('http://127.0.0.1:$port/$id/objects/50');
14 14
15 onRequestCompleted(Map reply) { 15 onRequestCompleted(Map reply) {
16 Expect.equals('Null', reply['type']); 16 Expect.equals('Sentinel', reply['type']);
17 Expect.equals('<expired>', reply['valueAsString']);
17 } 18 }
18 } 19 }
19 20
20 class BadCollectionTest extends VmServiceRequestHelper { 21 class BadCollectionTest extends VmServiceRequestHelper {
21 BadCollectionTest(port, id) : 22 BadCollectionTest(port, id) :
22 super('http://127.0.0.1:$port/$id/objects'); 23 super('http://127.0.0.1:$port/$id/objects');
23 24
24 onRequestCompleted(Map reply) { 25 onRequestCompleted(Map reply) {
25 Expect.equals('Error', reply['type']); 26 Expect.equals('Error', reply['type']);
26 } 27 }
(...skipping 10 matching lines...) Expand all
37 } 38 }
38 } 39 }
39 40
40 main() { 41 main() {
41 var process = new TestLauncher('unknown_isolate_command_script.dart'); 42 var process = new TestLauncher('unknown_isolate_command_script.dart');
42 process.launch().then((port) { 43 process.launch().then((port) {
43 var test = new VMTest(port); 44 var test = new VMTest(port);
44 test.makeRequest().then((_) { 45 test.makeRequest().then((_) {
45 var badCollectionRequest = 46 var badCollectionRequest =
46 new BadCollectionTest(port, test._isolateId).makeRequest(); 47 new BadCollectionTest(port, test._isolateId).makeRequest();
47 var nullCollectionRequest = 48 var expiredCollectionRequest =
48 new NullCollectionTest(port, test._isolateId).makeRequest(); 49 new ExpiredCollectionTest(port, test._isolateId).makeRequest();
49 var requests = Future.wait([badCollectionRequest, nullCollectionRequest]); 50 var requests = Future.wait([badCollectionRequest,
51 expiredCollectionRequest]);
50 requests.then((_) { 52 requests.then((_) {
51 process.requestExit(); 53 process.requestExit();
52 }); 54 });
53 }); 55 });
54 }); 56 });
55 } 57 }
OLDNEW
« no previous file with comments | « runtime/vm/service_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698