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

Side by Side Diff: services/dart/dart_apptests/echo_apptests.dart

Issue 987523002: Dart: Fixes bug in MojoEventStreamListener (Closed) Base URL: git@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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 import 'mojo:application'; 6 import 'mojo:application';
7 import 'mojo:bindings'; 7 import 'mojo:bindings';
8 import 'mojo:core'; 8 import 'mojo:core';
9 9
10 import 'package:apptest/apptest.dart'; 10 import 'package:apptest/apptest.dart';
11 import 'package:services/dart/test/echo_service.mojom.dart'; 11 import 'package:services/dart/test/echo_service.mojom.dart';
12 12
13 echoApptests(Application application) { 13 echoApptests(Application application) {
14 group('Echo Service Apptests', () { 14 group('Echo Service Apptests', () {
15 test('String', () { (() async { 15 test('String', () async {
16 var echoProxy = new EchoServiceProxy.unbound(); 16 var echoProxy = new EchoServiceProxy.unbound();
17 application.connectToService("mojo:dart_echo", echoProxy); 17 application.connectToService("mojo:dart_echo", echoProxy);
18 18
19 var v = await echoProxy.ptr.echoString("foo"); 19 var v = await echoProxy.ptr.echoString("foo");
20 expect(v.value, equals("foo")); 20 expect(v.value, equals("foo"));
21 21
22 var q = await echoProxy.ptr.echoString("quit"); 22 var q = await echoProxy.ptr.echoString("quit");
23 expect(q.value, equals("quit")); 23 expect(q.value, equals("quit"));
24 })().then(expectAsync((_) => null));});
25 24
26 test('Empty String', () { (() async { 25 echoProxy.close();
26 });
27
28 test('Empty String', () async {
27 var echoProxy = new EchoServiceProxy.unbound(); 29 var echoProxy = new EchoServiceProxy.unbound();
28 application.connectToService("mojo:dart_echo", echoProxy); 30 application.connectToService("mojo:dart_echo", echoProxy);
29 31
30 var v = await echoProxy.ptr.echoString(""); 32 var v = await echoProxy.ptr.echoString("");
31 expect(v.value, equals("")); 33 expect(v.value, equals(""));
32 34
33 var q = await echoProxy.ptr.echoString("quit"); 35 var q = await echoProxy.ptr.echoString("quit");
34 expect(q.value, equals("quit")); 36 expect(q.value, equals("quit"));
35 })().then(expectAsync((_) => null));});
36 37
37 test('Null String', () { (() async { 38 echoProxy.close();
39 });
40
41 test('Null String', () async {
38 var echoProxy = new EchoServiceProxy.unbound(); 42 var echoProxy = new EchoServiceProxy.unbound();
39 application.connectToService("mojo:dart_echo", echoProxy); 43 application.connectToService("mojo:dart_echo", echoProxy);
40 44
41 var v = await echoProxy.ptr.echoString(null); 45 var v = await echoProxy.ptr.echoString(null);
42 expect(v.value, equals(null)); 46 expect(v.value, equals(null));
43 47
44 var q = await echoProxy.ptr.echoString("quit"); 48 var q = await echoProxy.ptr.echoString("quit");
45 expect(q.value, equals("quit")); 49 expect(q.value, equals("quit"));
46 })().then(expectAsync((_) => null));}); 50
51 echoProxy.close();
52 });
47 }); 53 });
48 } 54 }
OLDNEW
« no previous file with comments | « mojo/public/dart/src/event_stream.dart ('k') | services/dart/dart_apptests/pingpong_apptests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698