| 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_echo_test; | 5 library isolate_echo_test; |
| 6 | 6 |
| 7 import 'test_helper.dart'; | 7 import 'test_helper.dart'; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 class EchoRequestTest extends VmServiceRequestHelper { | 10 class EchoRequestTest extends VmServiceRequestHelper { |
| 11 EchoRequestTest(port, id) : | 11 EchoRequestTest(port, id) : |
| 12 super('http://127.0.0.1:$port/isolates/$id/_echo/foo/bar?a=b&k=&d=e&z=w'); | 12 super('http://127.0.0.1:$port/$id/_echo/foo/bar?a=b&k=&d=e&z=w'); |
| 13 | 13 |
| 14 onRequestCompleted(Map reply) { | 14 onRequestCompleted(Map reply) { |
| 15 Expect.equals('message', reply['type']); | 15 Expect.equals('message', reply['type']); |
| 16 | 16 |
| 17 Expect.equals(3, reply['message']['arguments'].length); | 17 Expect.equals(3, reply['message']['arguments'].length); |
| 18 Expect.equals('_echo', reply['message']['arguments'][0]); | 18 Expect.equals('_echo', reply['message']['arguments'][0]); |
| 19 Expect.equals('foo', reply['message']['arguments'][1]); | 19 Expect.equals('foo', reply['message']['arguments'][1]); |
| 20 Expect.equals('bar', reply['message']['arguments'][2]); | 20 Expect.equals('bar', reply['message']['arguments'][2]); |
| 21 | 21 |
| 22 Expect.equals(4, reply['message']['option_keys'].length); | 22 Expect.equals(4, reply['message']['option_keys'].length); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 process.launch().then((port) { | 51 process.launch().then((port) { |
| 52 var test = new IsolateListTest(port); | 52 var test = new IsolateListTest(port); |
| 53 test.makeRequest().then((_) { | 53 test.makeRequest().then((_) { |
| 54 var echoRequestTest = new EchoRequestTest(port, test._isolateId); | 54 var echoRequestTest = new EchoRequestTest(port, test._isolateId); |
| 55 echoRequestTest.makeRequest().then((_) { | 55 echoRequestTest.makeRequest().then((_) { |
| 56 process.requestExit(); | 56 process.requestExit(); |
| 57 }); | 57 }); |
| 58 }); | 58 }); |
| 59 }); | 59 }); |
| 60 } | 60 } |
| OLD | NEW |