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

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

Issue 1098763004: Fix running browser tests in subdirectories and release 0.12.0-beta.10. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 8 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 | « pubspec.yaml ('k') | test/runner/runner_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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:path/path.dart' as p; 9 import 'package:path/path.dart' as p;
10 import 'package:test/src/util/io.dart'; 10 import 'package:test/src/util/io.dart';
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 expect("Compiling".allMatches(result.stdout), hasLength(1)); 291 expect("Compiling".allMatches(result.stdout), hasLength(1));
292 expect(result.exitCode, equals(0)); 292 expect(result.exitCode, equals(0));
293 }); 293 });
294 294
295 test("on the browser and the VM", () { 295 test("on the browser and the VM", () {
296 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); 296 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success);
297 var result = _runUnittest(["-p", "chrome", "-p", "vm", "test.dart"]); 297 var result = _runUnittest(["-p", "chrome", "-p", "vm", "test.dart"]);
298 expect(result.exitCode, equals(0)); 298 expect(result.exitCode, equals(0));
299 }); 299 });
300 300
301 // Regression test; this broke in 0.12.0-beta.9.
302 test("on a file in a subdirectory", () {
303 new Directory(p.join(_sandbox, "dir")).createSync();
304 new File(p.join(_sandbox, "dir", "test.dart"))
305 .writeAsStringSync(_success);
306 var result = _runUnittest(["-p", "chrome", "dir/test.dart"]);
307 expect(result.exitCode, equals(0));
308 });
309
301 group("with a custom HTML file", () { 310 group("with a custom HTML file", () {
302 setUp(() { 311 setUp(() {
303 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" 312 new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
304 import 'dart:html'; 313 import 'dart:html';
305 314
306 import 'package:test/test.dart'; 315 import 'package:test/test.dart';
307 316
308 void main() { 317 void main() {
309 test("success", () { 318 test("success", () {
310 expect(document.query('#foo'), isNotNull); 319 expect(document.query('#foo'), isNotNull);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 '''); 490 ''');
482 491
483 var result = _runUnittest(["-p", "chrome", "test.dart"]); 492 var result = _runUnittest(["-p", "chrome", "test.dart"]);
484 expect(result.stdout, contains("Test timed out after 0 seconds.")); 493 expect(result.stdout, contains("Test timed out after 0 seconds."));
485 expect(result.stdout, contains("-1: Some tests failed.")); 494 expect(result.stdout, contains("-1: Some tests failed."));
486 }); 495 });
487 } 496 }
488 497
489 ProcessResult _runUnittest(List<String> args) => 498 ProcessResult _runUnittest(List<String> args) =>
490 runUnittest(args, workingDirectory: _sandbox); 499 runUnittest(args, workingDirectory: _sandbox);
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/runner/runner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698