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

Side by Side Diff: test/frontend/tear_down_all_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/frontend/set_up_all_test.dart ('k') | test/runner/configuration/top_level_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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:async/async.dart'; 7 import 'package:async/async.dart';
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 import '../utils.dart'; 10 import '../utils.dart';
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 test("after", () { 256 test("after", () {
257 expect(tearDownAllRun, isTrue); 257 expect(tearDownAllRun, isTrue);
258 }); 258 });
259 }); 259 });
260 }); 260 });
261 }); 261 });
262 262
263 test("isn't run for a skipped group", () async { 263 test("isn't run for a skipped group", () async {
264 // Declare this in the outer test so if it runs, the outer test will fail. 264 // Declare this in the outer test so if it runs, the outer test will fail.
265 var shouldNotRun = expectAsync(() {}, count: 0); 265 var shouldNotRun = expectAsync0(() {}, count: 0);
266 266
267 var engine = declareEngine(() { 267 var engine = declareEngine(() {
268 group("skipped", () { 268 group("skipped", () {
269 tearDownAll(shouldNotRun); 269 tearDownAll(shouldNotRun);
270 270
271 test("test", () {}); 271 test("test", () {});
272 }, skip: true); 272 }, skip: true);
273 }); 273 });
274 274
275 await engine.run(); 275 await engine.run();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 expect(engine.liveTests, contains(tearDownAllLiveTest)); 332 expect(engine.liveTests, contains(tearDownAllLiveTest));
333 expect(engine.failed, contains(tearDownAllLiveTest)); 333 expect(engine.failed, contains(tearDownAllLiveTest));
334 expect(engine.passed, isNot(contains(tearDownAllLiveTest))); 334 expect(engine.passed, isNot(contains(tearDownAllLiveTest)));
335 expect(engine.skipped, isNot(contains(tearDownAllLiveTest))); 335 expect(engine.skipped, isNot(contains(tearDownAllLiveTest)));
336 expect(engine.active, isNot(contains(tearDownAllLiveTest))); 336 expect(engine.active, isNot(contains(tearDownAllLiveTest)));
337 }); 337 });
338 338
339 test("runs further tearDownAlls", () async { 339 test("runs further tearDownAlls", () async {
340 // Declare this in the outer test so if it doesn't runs, the outer test 340 // Declare this in the outer test so if it doesn't runs, the outer test
341 // will fail. 341 // will fail.
342 var shouldRun = expectAsync(() {}); 342 var shouldRun = expectAsync0(() {});
343 343
344 var engine = declareEngine(() { 344 var engine = declareEngine(() {
345 tearDownAll(() => throw "error"); 345 tearDownAll(() => throw "error");
346 tearDownAll(shouldRun); 346 tearDownAll(shouldRun);
347 347
348 test("test", () {}); 348 test("test", () {});
349 }); 349 });
350 350
351 expect(await engine.run(), isFalse); 351 expect(await engine.run(), isFalse);
352 }); 352 });
353 353
354 test("runs outer tearDownAlls", () async { 354 test("runs outer tearDownAlls", () async {
355 // Declare this in the outer test so if it doesn't runs, the outer test 355 // Declare this in the outer test so if it doesn't runs, the outer test
356 // will fail. 356 // will fail.
357 var shouldRun = expectAsync(() {}); 357 var shouldRun = expectAsync0(() {});
358 358
359 var engine = declareEngine(() { 359 var engine = declareEngine(() {
360 tearDownAll(shouldRun); 360 tearDownAll(shouldRun);
361 361
362 group("group", () { 362 group("group", () {
363 tearDownAll(() => throw "error"); 363 tearDownAll(() => throw "error");
364 364
365 test("test", () {}); 365 test("test", () {});
366 }); 366 });
367 }); 367 });
368 368
369 expect(await engine.run(), isFalse); 369 expect(await engine.run(), isFalse);
370 }); 370 });
371 }); 371 });
372 } 372 }
OLDNEW
« no previous file with comments | « test/frontend/set_up_all_test.dart ('k') | test/runner/configuration/top_level_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698