Skip to content
Snippets Groups Projects
Commit 4811a3fd authored by Natalie Weizenbaum's avatar Natalie Weizenbaum
Browse files

Disable timeouts when debugging.

R=kevmoo@google.com

Review URL: https://codereview.chromium.org//1263593005 .
parent 7b8bc4e3
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import 'package:async/async.dart';
import 'backend/metadata.dart';
import 'backend/test_platform.dart';
import 'frontend/timeout.dart';
import 'runner/application_exception.dart';
import 'runner/configuration.dart';
import 'runner/engine.dart';
......@@ -56,6 +57,7 @@ class Runner {
/// Creates a new runner based on [configuration].
factory Runner(Configuration configuration) {
var metadata = new Metadata(
timeout: configuration.pauseAfterLoad ? Timeout.none : null,
verboseTrace: configuration.verboseTrace);
var loader = new Loader(configuration.platforms,
pubServeUrl: configuration.pubServeUrl,
......@@ -96,7 +98,6 @@ class Runner {
var success;
if (_configuration.pauseAfterLoad) {
// TODO(nweiz): disable timeouts when debugging.
success = await _loadThenPause(suites);
} else {
_suiteSubscription = suites.listen(_engine.suiteSink.add);
......
......@@ -235,6 +235,44 @@ void main() {
test.stderr.expect(isDone);
}, testOn: "!windows");
test("disables timeouts", () {
d.file("test.dart", """
import 'package:test/test.dart';
void main() {
print('loaded test 1!');
test("success", () {}, timeout: new Timeout(Duration.ZERO));
}
""").create();
var test = runTest(
["--pause-after-load", "-p", "dartium", "-n", "success", "test.dart"]);
test.stdout.expect(consumeThrough("loaded test 1!"));
test.stdout.expect(consumeThrough(inOrder([
"The test runner is paused. Open the dev console in Dartium 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);
});
// Regression test for #304.
test("supports test name patterns", () {
d.file("test.dart", """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment