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

Side by Side Diff: test/runner/signal_test.dart

Issue 2515303002: Add expectAsyncX and expectAsyncUntilX methods, and deprecate the old methods. (Closed)
Patch Set: Mark parameter types as Object. Created 4 years 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
« no previous file with comments | « test/runner/pause_after_load_test.dart ('k') | test/util/forkable_stream_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Windows doesn't support sending signals. 5 // Windows doesn't support sending signals.
6 @TestOn("vm && !windows") 6 @TestOn("vm && !windows")
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 tearDown(() { 228 tearDown(() {
229 new File("output").writeAsStringSync(expectAsyncThrewError.toString()); 229 new File("output").writeAsStringSync(expectAsyncThrewError.toString());
230 }); 230 });
231 231
232 test("test", () async { 232 test("test", () async {
233 print("running test"); 233 print("running test");
234 234
235 await new Future.delayed(new Duration(seconds: 1)); 235 await new Future.delayed(new Duration(seconds: 1));
236 try { 236 try {
237 expectAsync(() {}); 237 expectAsync0(() {});
238 } catch (_) { 238 } catch (_) {
239 expectAsyncThrewError = true; 239 expectAsyncThrewError = true;
240 } 240 }
241 }); 241 });
242 } 242 }
243 """).create(); 243 """).create();
244 244
245 var test = _runTest(["test.dart"]); 245 var test = _runTest(["test.dart"]);
246 test.stdout.expect(consumeThrough("running test")); 246 test.stdout.expect(consumeThrough("running test"));
247 signalAndQuit(test); 247 signalAndQuit(test);
(...skipping 11 matching lines...) Expand all
259 259
260 void signalAndQuit(ScheduledProcess test) { 260 void signalAndQuit(ScheduledProcess test) {
261 test.signal(ProcessSignal.SIGTERM); 261 test.signal(ProcessSignal.SIGTERM);
262 test.shouldExit(); 262 test.shouldExit();
263 test.stderr.expect(isDone); 263 test.stderr.expect(isDone);
264 } 264 }
265 265
266 void expectTempDirEmpty() { 266 void expectTempDirEmpty() {
267 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty)); 267 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty));
268 } 268 }
OLDNEW
« no previous file with comments | « test/runner/pause_after_load_test.dart ('k') | test/util/forkable_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698