| 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 vmservice_test_helper; | 5 library vmservice_test_helper; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 class FieldRequestHelper extends VmServiceRequestHelper { | 215 class FieldRequestHelper extends VmServiceRequestHelper { |
| 216 FieldRequestHelper(port, isolate_id, field_id) : | 216 FieldRequestHelper(port, isolate_id, field_id) : |
| 217 super('http://127.0.0.1:$port/isolates/$isolate_id/objects/$field_id'); | 217 super('http://127.0.0.1:$port/isolates/$isolate_id/objects/$field_id'); |
| 218 Map field; | 218 Map field; |
| 219 onRequestCompleted(Map reply) { | 219 onRequestCompleted(Map reply) { |
| 220 Expect.equals('Field', reply['type']); | 220 Expect.equals('Field', reply['type']); |
| 221 field = reply; | 221 field = reply; |
| 222 return this; | 222 return new Future.value(this); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 class ClassFieldRequestHelper extends VmServiceRequestHelper { | 226 class ClassFieldRequestHelper extends VmServiceRequestHelper { |
| 227 final List<String> fieldNames; | 227 final List<String> fieldNames; |
| 228 int port_; | 228 int port_; |
| 229 int isolate_id_; | 229 int isolate_id_; |
| 230 ClassFieldRequestHelper(port, isolate_id, class_id, this.fieldNames) : | 230 ClassFieldRequestHelper(port, isolate_id, class_id, this.fieldNames) : |
| 231 super('http://127.0.0.1:$port/isolates/$isolate_id/classes/$class_id') { | 231 super('http://127.0.0.1:$port/isolates/$isolate_id/classes/$class_id') { |
| 232 port_ = port; | 232 port_ = port; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 247 }); | 247 }); |
| 248 }); | 248 }); |
| 249 return Future.wait(requests).then((a) { | 249 return Future.wait(requests).then((a) { |
| 250 a.forEach((FieldRequestHelper field) { | 250 a.forEach((FieldRequestHelper field) { |
| 251 fields[field.field['user_name']] = field.field; | 251 fields[field.field['user_name']] = field.field; |
| 252 }); | 252 }); |
| 253 return this; | 253 return this; |
| 254 }); | 254 }); |
| 255 } | 255 } |
| 256 } | 256 } |
| OLD | NEW |