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

Side by Side 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: Created 5 years, 9 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 2015 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 import 'mojo:application';
7 import 'mojo:bindings';
8 import 'mojo:core';
9
10 import 'package:apptest/apptest.dart';
11 import 'package:services/dart/test/echo_service.mojom.dart';
12
13 echoApptests(Application application) {
14 group('Echo Service Apptests', () {
15 test('String', () async {
16 var echoProxy = new EchoServiceProxy.unbound();
17 application.connectToService("mojo:dart_echo", echoProxy);
18
19 var v = await echoProxy.ptr.echoString("foo");
20 expect(v.value, equals("foo"));
21
22 var q = await echoProxy.ptr.echoString("quit");
23 expect(q.value, equals("quit"));
24 });
25
26 test('Empty String', () async {
27 var echoProxy = new EchoServiceProxy.unbound();
28 application.connectToService("mojo:dart_echo", echoProxy);
29
30 var v = await echoProxy.ptr.echoString("");
31 expect(v.value, equals(""));
32
33 var q = await echoProxy.ptr.echoString("quit");
34 expect(q.value, equals("quit"));
35 });
36
37 test('Null String', () async {
38 var echoProxy = new EchoServiceProxy.unbound();
39 application.connectToService("mojo:dart_echo", echoProxy);
40
41 var v = await echoProxy.ptr.echoString(null);
42 expect(v.value, equals(null));
43
44 var q = await echoProxy.ptr.echoString("quit");
45 expect(q.value, equals("quit"));
46 });
47 });
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698