OLD | NEW |
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 test("on content shell", () { | 337 test("on content shell", () { |
338 var result = _runUnittest(["-p", "content-shell", "test.dart"]); | 338 var result = _runUnittest(["-p", "content-shell", "test.dart"]); |
339 expect(result.exitCode, equals(0)); | 339 expect(result.exitCode, equals(0)); |
340 }); | 340 }); |
341 | 341 |
342 test("on Chrome", () { | 342 test("on Chrome", () { |
343 var result = _runUnittest(["-p", "chrome", "test.dart"]); | 343 var result = _runUnittest(["-p", "chrome", "test.dart"]); |
344 expect(result.exitCode, equals(0)); | 344 expect(result.exitCode, equals(0)); |
345 }); | 345 }); |
| 346 |
| 347 // Regression test for https://github.com/dart-lang/test/issues/82. |
| 348 test("ignores irrelevant link tags", () { |
| 349 new File(p.join(_sandbox, "test.html")).writeAsStringSync(""" |
| 350 <html> |
| 351 <head> |
| 352 <link rel='x-dart-test-not'> |
| 353 <link rel='other' href='test.dart'> |
| 354 <link rel='x-dart-test' href='test.dart'> |
| 355 <script src="packages/test/dart.js"></script> |
| 356 </head> |
| 357 <body> |
| 358 <div id="foo"></div> |
| 359 </body> |
| 360 </html> |
| 361 """); |
| 362 |
| 363 var result = _runUnittest(["-p", "content-shell", "test.dart"]); |
| 364 expect(result.exitCode, equals(0)); |
| 365 }); |
346 }); | 366 }); |
347 }); | 367 }); |
348 | 368 |
349 group("runs failing tests", () { | 369 group("runs failing tests", () { |
350 test("on Chrome", () { | 370 test("on Chrome", () { |
351 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); | 371 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
352 var result = _runUnittest(["-p", "chrome", "test.dart"]); | 372 var result = _runUnittest(["-p", "chrome", "test.dart"]); |
353 expect(result.exitCode, equals(1)); | 373 expect(result.exitCode, equals(1)); |
354 }); | 374 }); |
355 | 375 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 '''); | 510 '''); |
491 | 511 |
492 var result = _runUnittest(["-p", "chrome", "test.dart"]); | 512 var result = _runUnittest(["-p", "chrome", "test.dart"]); |
493 expect(result.stdout, contains("Test timed out after 0 seconds.")); | 513 expect(result.stdout, contains("Test timed out after 0 seconds.")); |
494 expect(result.stdout, contains("-1: Some tests failed.")); | 514 expect(result.stdout, contains("-1: Some tests failed.")); |
495 }); | 515 }); |
496 } | 516 } |
497 | 517 |
498 ProcessResult _runUnittest(List<String> args) => | 518 ProcessResult _runUnittest(List<String> args) => |
499 runUnittest(args, workingDirectory: _sandbox); | 519 runUnittest(args, workingDirectory: _sandbox); |
OLD | NEW |