Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Side by Side Diff: mojo/dart/apptests/test_apps/echo_with_service_describer/lib/main.dart

Issue 1648803006: Expose Service Describer in Dart mojo package (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address zra's feedback Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698