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

Side by Side Diff: mojo/dart/test/validation_test.dart

Issue 1439993003: Dart: Avoid MojoResult and MojoHandleSignals constructors. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Small fixes Created 5 years, 1 month 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 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 import 'dart:mojo.builtin' as builtin; 8 import 'dart:mojo.builtin' as builtin;
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // TODO(zra): Make the error messages conform? 89 // TODO(zra): Make the error messages conform?
90 // assert(e == expected); 90 // assert(e == expected);
91 conformanceImpl.close(); 91 conformanceImpl.close();
92 pipe.endpoints[0].close(); 92 pipe.endpoints[0].close();
93 pipe.endpoints[1].close(); 93 pipe.endpoints[1].close();
94 handles.forEach((h) => h.close()); 94 handles.forEach((h) => h.close());
95 completer.completeError(null); 95 completer.completeError(null);
96 }); 96 });
97 97
98 var length = (test.data == null) ? 0 : test.data.lengthInBytes; 98 var length = (test.data == null) ? 0 : test.data.lengthInBytes;
99 var r = pipe.endpoints[1].write(test.data, length, handles); 99 int r = pipe.endpoints[1].write(test.data, length, handles);
100 assert(r.isOk); 100 assert(r == MojoResult.kOk);
101 101
102 return completer.future.then((_) { 102 return completer.future.then((_) {
103 assert(expected == "PASS"); 103 assert(expected == "PASS");
104 return conformanceImpl.close().then((_) { 104 return conformanceImpl.close().then((_) {
105 pipe.endpoints[0].close(); 105 pipe.endpoints[0].close();
106 pipe.endpoints[1].close(); 106 pipe.endpoints[1].close();
107 handles.forEach((h) => h.close()); 107 handles.forEach((h) => h.close());
108 }); 108 });
109 }, onError: (e) { 109 }, onError: (e) {
110 // Do nothing. 110 // Do nothing.
(...skipping 16 matching lines...) Expand all
127 try { 127 try {
128 await runTest(name, parser.parse(data), expected); 128 await runTest(name, parser.parse(data), expected);
129 print('$name PASSED.'); 129 print('$name PASSED.');
130 } catch (e) { 130 } catch (e) {
131 print('$name FAILED: $e'); 131 print('$name FAILED: $e');
132 } 132 }
133 } 133 }
134 // TODO(zra): Add integration tests when they no longer rely on Client= 134 // TODO(zra): Add integration tests when they no longer rely on Client=
135 MojoHandle.reportLeakedHandles(); 135 MojoHandle.reportLeakedHandles();
136 } 136 }
OLDNEW
« mojo/dart/packages/mojo/lib/src/types.dart ('K') | « mojo/dart/test/ping_pong_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698