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

Unified Diff: services/dart/dart_apptests/echo_apptests.dart

Issue 971083002: Create an apptesting framework for dart. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Update upload_binaries.py to add the apptest.dartzip artifact. Created 5 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: services/dart/dart_apptests/echo_apptests.dart
diff --git a/services/dart/dart_apptests/echo_apptests.dart b/services/dart/dart_apptests/echo_apptests.dart
new file mode 100644
index 0000000000000000000000000000000000000000..27d249770890dddbe6f13b82fe7e992fd201696f
--- /dev/null
+++ b/services/dart/dart_apptests/echo_apptests.dart
@@ -0,0 +1,48 @@
+// Copyright 2015 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 'mojo:application';
+import 'mojo:bindings';
+import 'mojo:core';
+
+import 'package:apptest/apptest.dart';
+import 'package:services/dart/test/echo_service.mojom.dart';
+
+echoApptests(Application application) {
+ group('Echo Service Apptests', () {
+ test('String', () async {
+ var echoProxy = new EchoServiceProxy.unbound();
+ application.connectToService("mojo:dart_echo", echoProxy);
+
+ var v = await echoProxy.ptr.echoString("foo");
+ expect(v.value, equals("foo"));
+
+ var q = await echoProxy.ptr.echoString("quit");
+ expect(q.value, equals("quit"));
+ });
+
+ test('Empty String', () async {
+ var echoProxy = new EchoServiceProxy.unbound();
+ application.connectToService("mojo:dart_echo", echoProxy);
+
+ var v = await echoProxy.ptr.echoString("");
+ expect(v.value, equals(""));
+
+ var q = await echoProxy.ptr.echoString("quit");
+ expect(q.value, equals("quit"));
+ });
+
+ test('Null String', () async {
+ var echoProxy = new EchoServiceProxy.unbound();
+ application.connectToService("mojo:dart_echo", echoProxy);
+
+ var v = await echoProxy.ptr.echoString(null);
+ expect(v.value, equals(null));
+
+ var q = await echoProxy.ptr.echoString("quit");
+ expect(q.value, equals("quit"));
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698