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 pingpong_apptests; | 5 library pingpong_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/pingpong_service.mojom.dart'; | 10 import 'package:mojom/dart/test/pingpong_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 class _TestingPingPongClient extends PingPongClient { | 15 class _TestingPingPongClient extends PingPongClient { |
16 final PingPongClientStub stub; | 16 final PingPongClientStub stub; |
17 Completer _completer; | 17 Completer _completer; |
18 | 18 |
19 _TestingPingPongClient.unbound() : stub = new PingPongClientStub.unbound() { | 19 _TestingPingPongClient.unbound() : stub = new PingPongClientStub.unbound() { |
20 stub.impl = this; | 20 stub.impl = this; |
21 } | 21 } |
22 | 22 |
23 waitForPong() async { | 23 waitForPong() async { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 targetServiceProxy.ptr.ping(100); | 106 targetServiceProxy.ptr.ping(100); |
107 pongValue = await pingPongClient.waitForPong(); | 107 pongValue = await pingPongClient.waitForPong(); |
108 expect(pongValue, equals(101)); | 108 expect(pongValue, equals(101)); |
109 | 109 |
110 await pingPongClient.stub.close(); | 110 await pingPongClient.stub.close(); |
111 await targetServiceProxy.close(); | 111 await targetServiceProxy.close(); |
112 await pingPongServiceProxy.close(); | 112 await pingPongServiceProxy.close(); |
113 }); | 113 }); |
114 }); | 114 }); |
115 } | 115 } |
OLD | NEW |