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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: mojo/dart/apptests/test_apps/echo_with_service_describer/lib/main.dart
diff --git a/mojo/dart/apptests/test_apps/echo_with_service_describer/lib/main.dart b/mojo/dart/apptests/test_apps/echo_with_service_describer/lib/main.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7ab9032e7bf7a4e73acd1af26cb78a32f53a872b
--- /dev/null
+++ b/mojo/dart/apptests/test_apps/echo_with_service_describer/lib/main.dart
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:mojo/application.dart';
+import 'package:mojo/bindings.dart';
+import 'package:mojo/core.dart';
+import 'package:_mojo_for_test_only/test/echo_service.mojom.dart';
+
+/// DummyEchoServiceImpl is unused in the corresponding test_app.
+class DummyEchoServiceImpl implements EchoService {
+ dynamic echoString(String value, [Function responseFactory]) => null;
+
+ dynamic delayedEchoString(String value, int millis,
+ [Function responseFactory]) => null;
+
+ void quit() {}
+}
+
+class EchoApplication extends Application {
+ EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
+
+ @override
+ void acceptConnection(String requestorUrl, String resolvedUrl,
+ ApplicationConnection connection) {
+ connection.provideService(EchoService.serviceName,
+ (endpoint) => new DummyEchoServiceImpl(),
+ description: EchoServiceStub.serviceDescription);
+ }
+}
+
+main(List args) {
+ MojoHandle appHandle = new MojoHandle(args[0]);
+ String url = args[1];
+ new EchoApplication.fromHandle(appHandle)
+ ..onError = ((_) {
+ MojoHandle.reportLeakedHandles();
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698