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

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

Issue 1874553002: Dart: Fix bug in unbind() for Stubs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:mojo/application.dart'; 7 import 'package:mojo/application.dart';
8 import 'package:mojo/bindings.dart'; 8 import 'package:mojo/bindings.dart';
9 import 'package:mojo/core.dart'; 9 import 'package:mojo/core.dart';
10 import 'package:_mojo_for_test_only/test/echo_service.mojom.dart'; 10 import 'package:_mojo_for_test_only/test/echo_service.mojom.dart';
11 11
12 /// DummyEchoServiceImpl is unused in the corresponding test_app. 12 /// DummyEchoServiceImpl is unused in the corresponding test_app.
13 class DummyEchoServiceImpl implements EchoService { 13 class DummyEchoServiceImpl implements EchoService {
14 dynamic echoString(String value, [Function responseFactory]) => null; 14 dynamic echoString(String value, [Function responseFactory]) => null;
15 15
16 dynamic delayedEchoString(String value, int millis, 16 dynamic delayedEchoString(String value, int millis,
17 [Function responseFactory]) => null; 17 [Function responseFactory]) => null;
18 18
19 void swap() {}
20
19 void quit() {} 21 void quit() {}
20 } 22 }
21 23
22 class EchoApplication extends Application { 24 class EchoApplication extends Application {
23 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); 25 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
24 26
25 @override 27 @override
26 void acceptConnection(String requestorUrl, String resolvedUrl, 28 void acceptConnection(String requestorUrl, String resolvedUrl,
27 ApplicationConnection connection) { 29 ApplicationConnection connection) {
28 connection.provideService(EchoService.serviceName, 30 connection.provideService(EchoService.serviceName,
29 (endpoint) => new DummyEchoServiceImpl(), 31 (endpoint) => new DummyEchoServiceImpl(),
30 description: EchoServiceStub.serviceDescription); 32 description: EchoServiceStub.serviceDescription);
31 } 33 }
32 } 34 }
33 35
34 main(List args, Object handleToken) { 36 main(List args, Object handleToken) {
35 MojoHandle appHandle = new MojoHandle(handleToken); 37 MojoHandle appHandle = new MojoHandle(handleToken);
36 new EchoApplication.fromHandle(appHandle) 38 new EchoApplication.fromHandle(appHandle)
37 ..onError = ((_) { 39 ..onError = ((_) {
38 MojoHandle.reportLeakedHandles(); 40 MojoHandle.reportLeakedHandles();
39 }); 41 });
40 } 42 }
OLDNEW
« no previous file with comments | « mojo/dart/apptests/test_apps/echo/lib/main.dart ('k') | mojo/dart/apptests/test_apps/interfaces/echo_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698