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

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

Issue 1263593005: Disable timeouts when debugging. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 4 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 | « lib/src/runner.dart ('k') | 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 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:scheduled_test/descriptor.dart' as d; 10 import 'package:scheduled_test/descriptor.dart' as d;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 "The test runner is paused. Open the dev console in Dartium and set " 228 "The test runner is paused. Open the dev console in Dartium and set "
229 "breakpoints. Once you're", 229 "breakpoints. Once you're",
230 "finished, return to this terminal and press Enter." 230 "finished, return to this terminal and press Enter."
231 ]))); 231 ])));
232 232
233 test.signal(ProcessSignal.SIGTERM); 233 test.signal(ProcessSignal.SIGTERM);
234 test.shouldExit(); 234 test.shouldExit();
235 test.stderr.expect(isDone); 235 test.stderr.expect(isDone);
236 }, testOn: "!windows"); 236 }, testOn: "!windows");
237 237
238 test("disables timeouts", () {
239 d.file("test.dart", """
240 import 'package:test/test.dart';
241
242 void main() {
243 print('loaded test 1!');
244
245 test("success", () {}, timeout: new Timeout(Duration.ZERO));
246 }
247 """).create();
248
249 var test = runTest(
kevmoo 2015/07/28 22:43:56 perhaps pick a different name as to not overload '
nweiz 2015/07/29 00:33:01 This is consistent with other tests. It's also the
250 ["--pause-after-load", "-p", "dartium", "-n", "success", "test.dart"]);
251 test.stdout.expect(consumeThrough("loaded test 1!"));
252 test.stdout.expect(consumeThrough(inOrder([
253 "The test runner is paused. Open the dev console in Dartium and set "
254 "breakpoints. Once you're",
255 "finished, return to this terminal and press Enter."
256 ])));
257
258 schedule(() async {
259 var nextLineFired = false;
260 test.stdout.next().then(expectAsync((line) {
261 expect(line, contains("+0: success"));
262 nextLineFired = true;
263 }));
264
265 // Wait a little bit to be sure that the tests don't start running without
266 // our input.
267 await new Future.delayed(new Duration(seconds: 2));
268 expect(nextLineFired, isFalse);
269 });
270
271 test.writeLine('');
272 test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
273 test.shouldExit(0);
274 });
275
238 // Regression test for #304. 276 // Regression test for #304.
239 test("supports test name patterns", () { 277 test("supports test name patterns", () {
240 d.file("test.dart", """ 278 d.file("test.dart", """
241 import 'package:test/test.dart'; 279 import 'package:test/test.dart';
242 280
243 void main() { 281 void main() {
244 print('loaded test 1!'); 282 print('loaded test 1!');
245 283
246 test("failure 1", () {}); 284 test("failure 1", () {});
247 test("success", () {}); 285 test("success", () {});
(...skipping 21 matching lines...) Expand all
269 // our input. 307 // our input.
270 await new Future.delayed(new Duration(seconds: 2)); 308 await new Future.delayed(new Duration(seconds: 2));
271 expect(nextLineFired, isFalse); 309 expect(nextLineFired, isFalse);
272 }); 310 });
273 311
274 test.writeLine(''); 312 test.writeLine('');
275 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); 313 test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
276 test.shouldExit(0); 314 test.shouldExit(0);
277 }); 315 });
278 } 316 }
OLDNEW
« no previous file with comments | « lib/src/runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698