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

Unified Diff: test/runner/configuration/top_level_test.dart

Issue 1801363007: Add pause_after_load to the config file. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/configuration/top_level_error_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/configuration/top_level_test.dart
diff --git a/test/runner/configuration/top_level_test.dart b/test/runner/configuration/top_level_test.dart
index f98e8a9b93cecc76b3ae40bf9d9ed0d90d543cd4..445613d80ad7da85ad9d482cc37f0858c94bc7e6 100644
--- a/test/runner/configuration/top_level_test.dart
+++ b/test/runner/configuration/top_level_test.dart
@@ -4,6 +4,7 @@
@TestOn("vm")
+import 'dart:async';
import 'dart:convert';
import 'package:path/path.dart' as p;
@@ -33,6 +34,51 @@ void main() {
test.shouldExit(0);
});
+ test("pauses the test runner after a suite loads with pause_after_load: true",
+ () {
+ d.file("dart_test.yaml", JSON.encode({
+ "pause_after_load": true
+ })).create();
+
+ d.file("test.dart", """
+import 'package:test/test.dart';
+
+void main() {
+ print('loaded test!');
+
+ test("success", () {});
+}
+""").create();
+
+ var test = runTest(["-p", "content-shell", "test.dart"]);
+ test.stdout.expect(consumeThrough("loaded test!"));
+ test.stdout.expect(inOrder([
+ "",
+ startsWith("Observatory URL: "),
+ startsWith("Remote debugger URL: "),
+ "The test runner is paused. Open the remote debugger or the Observatory "
+ "and set breakpoints. Once",
+ "you're finished, return to this terminal and press Enter."
+ ]));
+
+ schedule(() async {
+ var nextLineFired = false;
+ test.stdout.next().then(expectAsync((line) {
+ expect(line, contains("+0: success"));
+ nextLineFired = true;
+ }));
+
+ // Wait a little bit to be sure that the tests don't start running without
+ // our input.
+ await new Future.delayed(new Duration(seconds: 2));
+ expect(nextLineFired, isFalse);
+ });
+
+ test.writeLine('');
+ test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
+ test.shouldExit(0);
+ }, tags: 'content-shell');
+
test("includes the full stack with verbose_trace: true", () {
d.file("dart_test.yaml", JSON.encode({
"verbose_trace": true
« no previous file with comments | « test/runner/configuration/top_level_error_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698