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

Side by Side Diff: test/runner/browser/runner_test.dart

Issue 1667663005: Fix a few more timeout tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'package:scheduled_test/descriptor.dart' as d; 7 import 'package:scheduled_test/descriptor.dart' as d;
8 import 'package:scheduled_test/scheduled_stream.dart'; 8 import 'package:scheduled_test/scheduled_stream.dart';
9 import 'package:scheduled_test/scheduled_test.dart'; 9 import 'package:scheduled_test/scheduled_test.dart';
10 10
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 test("respects top-level @Timeout declarations", () { 453 test("respects top-level @Timeout declarations", () {
454 d.file("test.dart", ''' 454 d.file("test.dart", '''
455 @Timeout(const Duration(seconds: 0)) 455 @Timeout(const Duration(seconds: 0))
456 456
457 import 'dart:async'; 457 import 'dart:async';
458 458
459 import 'package:test/test.dart'; 459 import 'package:test/test.dart';
460 460
461 void main() { 461 void main() {
462 test("timeout", () {}); 462 test("timeout", () => new Future.delayed(Duration.ZERO));
463 } 463 }
464 ''').create(); 464 ''').create();
465 465
466 var test = runTest(["-p", "content-shell", "test.dart"]); 466 var test = runTest(["-p", "content-shell", "test.dart"]);
467 test.stdout.expect(containsInOrder([ 467 test.stdout.expect(containsInOrder([
468 "Test timed out after 0 seconds.", 468 "Test timed out after 0 seconds.",
469 "-1: Some tests failed." 469 "-1: Some tests failed."
470 ])); 470 ]));
471 test.shouldExit(1); 471 test.shouldExit(1);
472 }); 472 });
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 test.shouldExit(0); 504 test.shouldExit(0);
505 }); 505 });
506 506
507 test("respects matching Timeouts", () { 507 test("respects matching Timeouts", () {
508 d.file("test.dart", ''' 508 d.file("test.dart", '''
509 import 'dart:async'; 509 import 'dart:async';
510 510
511 import 'package:test/test.dart'; 511 import 'package:test/test.dart';
512 512
513 void main() { 513 void main() {
514 test("fail", () => throw 'oh no', onPlatform: { 514 test("fail", () async {
515 "browser": new Timeout(new Duration(seconds: 0)) 515 await new Future.delayed(Duration.ZERO);
516 throw 'oh no';
517 }, onPlatform: {
518 "browser": new Timeout(Duration.ZERO)
516 }); 519 });
517 } 520 }
518 ''').create(); 521 ''').create();
519 522
520 var test = runTest(["-p", "content-shell", "test.dart"]); 523 var test = runTest(["-p", "content-shell", "test.dart"]);
521 test.stdout.expect(containsInOrder([ 524 test.stdout.expect(containsInOrder([
522 "Test timed out after 0 seconds.", 525 "Test timed out after 0 seconds.",
523 "-1: Some tests failed." 526 "-1: Some tests failed."
524 ])); 527 ]));
525 test.shouldExit(1); 528 test.shouldExit(1);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 d.file("test.dart", ''' 614 d.file("test.dart", '''
612 @OnPlatform(const { 615 @OnPlatform(const {
613 "browser": const Timeout(const Duration(seconds: 0)) 616 "browser": const Timeout(const Duration(seconds: 0))
614 }) 617 })
615 618
616 import 'dart:async'; 619 import 'dart:async';
617 620
618 import 'package:test/test.dart'; 621 import 'package:test/test.dart';
619 622
620 void main() { 623 void main() {
621 test("fail", () => throw 'oh no'); 624 test("fail", () async {
625 await new Future.delayed(Duration.ZERO);
626 throw 'oh no';
627 });
622 } 628 }
623 ''').create(); 629 ''').create();
624 630
625 var test = runTest(["-p", "content-shell", "test.dart"]); 631 var test = runTest(["-p", "content-shell", "test.dart"]);
626 test.stdout.expect(containsInOrder([ 632 test.stdout.expect(containsInOrder([
627 "Test timed out after 0 seconds.", 633 "Test timed out after 0 seconds.",
628 "-1: Some tests failed." 634 "-1: Some tests failed."
629 ])); 635 ]));
630 test.shouldExit(1); 636 test.shouldExit(1);
631 }); 637 });
(...skipping 12 matching lines...) Expand all
644 test("success", () {}); 650 test("success", () {});
645 } 651 }
646 ''').create(); 652 ''').create();
647 653
648 var test = runTest(["-p", "content-shell", "test.dart"]); 654 var test = runTest(["-p", "content-shell", "test.dart"]);
649 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); 655 test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
650 test.shouldExit(0); 656 test.shouldExit(0);
651 }); 657 });
652 }); 658 });
653 } 659 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698