OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library echo_apptests; | 5 library echo_apptests; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:apptest/apptest.dart'; | 9 import 'package:apptest/apptest.dart'; |
10 import 'package:mojom/dart/test/echo_service.mojom.dart'; | 10 import 'package:mojom/dart/test/echo_service.mojom.dart'; |
11 import 'package:mojo/public/dart/application.dart'; | 11 import 'package:mojo/application.dart'; |
12 import 'package:mojo/public/dart/bindings.dart'; | 12 import 'package:mojo/bindings.dart'; |
13 import 'package:mojo/public/dart/core.dart'; | 13 import 'package:mojo/core.dart'; |
14 | 14 |
15 echoApptests(Application application, String url) { | 15 echoApptests(Application application, String url) { |
16 group('Echo Service Apptests', () { | 16 group('Echo Service Apptests', () { |
17 test('String', () async { | 17 test('String', () async { |
18 var echoProxy = new EchoServiceProxy.unbound(); | 18 var echoProxy = new EchoServiceProxy.unbound(); |
19 application.connectToService("mojo:dart_echo", echoProxy); | 19 application.connectToService("mojo:dart_echo", echoProxy); |
20 | 20 |
21 var v = await echoProxy.ptr.echoString("foo"); | 21 var v = await echoProxy.ptr.echoString("foo"); |
22 expect(v.value, equals("foo")); | 22 expect(v.value, equals("foo")); |
23 | 23 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 throw 'unreachable'; | 79 throw 'unreachable'; |
80 }, onError: (e) { | 80 }, onError: (e) { |
81 expect(e is ProxyCloseException, isTrue); | 81 expect(e is ProxyCloseException, isTrue); |
82 }); | 82 }); |
83 | 83 |
84 return new Future.delayed( | 84 return new Future.delayed( |
85 new Duration(milliseconds: 10), () => echoProxy.close()); | 85 new Duration(milliseconds: 10), () => echoProxy.close()); |
86 }); | 86 }); |
87 }); | 87 }); |
88 } | 88 } |
OLD | NEW |