OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 import 'dart:async'; |
| 6 |
| 7 import 'package:mojo/application.dart'; |
| 8 import 'package:mojo/bindings.dart'; |
| 9 import 'package:mojo/core.dart'; |
| 10 import 'package:_mojo_for_test_only/test/echo_service.mojom.dart'; |
| 11 |
| 12 /// DummyEchoServiceImpl is unused in the corresponding test_app. |
| 13 class DummyEchoServiceImpl implements EchoService { |
| 14 dynamic echoString(String value, [Function responseFactory]) => null; |
| 15 |
| 16 dynamic delayedEchoString(String value, int millis, |
| 17 [Function responseFactory]) => null; |
| 18 |
| 19 void quit() {} |
| 20 } |
| 21 |
| 22 class EchoApplication extends Application { |
| 23 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
| 24 |
| 25 @override |
| 26 void acceptConnection(String requestorUrl, String resolvedUrl, |
| 27 ApplicationConnection connection) { |
| 28 connection.provideService(EchoService.serviceName, |
| 29 (endpoint) => new DummyEchoServiceImpl(), |
| 30 description: EchoServiceStub.serviceDescription); |
| 31 } |
| 32 } |
| 33 |
| 34 main(List args) { |
| 35 MojoHandle appHandle = new MojoHandle(args[0]); |
| 36 String url = args[1]; |
| 37 new EchoApplication.fromHandle(appHandle) |
| 38 ..onError = ((_) { |
| 39 MojoHandle.reportLeakedHandles(); |
| 40 }); |
| 41 } |
OLD | NEW |