| 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 library analyzer.test.src.task.html_test; | 5 library analyzer.test.src.task.html_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/source.dart'; | 7 import 'package:analyzer/src/generated/source.dart'; |
| 8 import 'package:analyzer/src/task/html.dart'; | 8 import 'package:analyzer/src/task/html.dart'; |
| 9 import 'package:analyzer/task/general.dart'; | 9 import 'package:analyzer/task/general.dart'; |
| 10 import 'package:analyzer/task/html.dart'; | 10 import 'package:analyzer/task/html.dart'; |
| 11 import 'package:analyzer/task/model.dart'; | 11 import 'package:analyzer/task/model.dart'; |
| 12 import 'package:html/dom.dart'; | 12 import 'package:html/dom.dart'; |
| 13 import 'package:test/test.dart'; |
| 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 14 import 'package:unittest/unittest.dart'; | |
| 15 | 15 |
| 16 import '../../utils.dart'; | 16 import '../../utils.dart'; |
| 17 import '../context/abstract_context.dart'; | 17 import '../context/abstract_context.dart'; |
| 18 | 18 |
| 19 main() { | 19 main() { |
| 20 initializeTestEnvironment(); | 20 initializeTestEnvironment(); |
| 21 defineReflectiveTests(DartScriptsTaskTest); | 21 defineReflectiveSuite(() { |
| 22 defineReflectiveTests(HtmlErrorsTaskTest); | 22 defineReflectiveTests(DartScriptsTaskTest); |
| 23 defineReflectiveTests(ParseHtmlTaskTest); | 23 defineReflectiveTests(HtmlErrorsTaskTest); |
| 24 defineReflectiveTests(ParseHtmlTaskTest); |
| 25 }); |
| 24 } | 26 } |
| 25 | 27 |
| 26 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); | 28 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); |
| 27 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); | 29 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); |
| 28 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); | 30 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); |
| 29 | 31 |
| 30 @reflectiveTest | 32 @reflectiveTest |
| 31 class DartScriptsTaskTest extends AbstractContextTest { | 33 class DartScriptsTaskTest extends AbstractContextTest { |
| 32 test_buildInputs() { | 34 test_buildInputs() { |
| 33 Source source = newSource('/test.html'); | 35 Source source = newSource('/test.html'); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 expect(bodyElement.localName, 'body'); | 373 expect(bodyElement.localName, 'body'); |
| 372 // actual nodes | 374 // actual nodes |
| 373 expect(bodyElement.nodes, hasLength(4)); | 375 expect(bodyElement.nodes, hasLength(4)); |
| 374 expect((bodyElement.nodes[0] as Element).localName, 'div'); | 376 expect((bodyElement.nodes[0] as Element).localName, 'div'); |
| 375 expect((bodyElement.nodes[2] as Element).localName, 'span'); | 377 expect((bodyElement.nodes[2] as Element).localName, 'span'); |
| 376 } | 378 } |
| 377 // it's OK to don't have DOCTYPE | 379 // it's OK to don't have DOCTYPE |
| 378 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); | 380 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); |
| 379 } | 381 } |
| 380 } | 382 } |
| OLD | NEW |