| 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_reflective_loader/test_reflective_loader.dart'; |
| 13 import 'package:unittest/unittest.dart'; | 14 import 'package:unittest/unittest.dart'; |
| 14 | 15 |
| 15 import '../../reflective_tests.dart'; | |
| 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 runReflectiveTests(DartScriptsTaskTest); | 21 defineReflectiveTests(DartScriptsTaskTest); |
| 22 runReflectiveTests(HtmlErrorsTaskTest); | 22 defineReflectiveTests(HtmlErrorsTaskTest); |
| 23 runReflectiveTests(ParseHtmlTaskTest); | 23 defineReflectiveTests(ParseHtmlTaskTest); |
| 24 } | 24 } |
| 25 | 25 |
| 26 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); | 26 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); |
| 27 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); | 27 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); |
| 28 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); | 28 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); |
| 29 | 29 |
| 30 @reflectiveTest | 30 @reflectiveTest |
| 31 class DartScriptsTaskTest extends AbstractContextTest { | 31 class DartScriptsTaskTest extends AbstractContextTest { |
| 32 test_buildInputs() { | 32 test_buildInputs() { |
| 33 Source source = newSource('/test.html'); | 33 Source source = newSource('/test.html'); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 expect(bodyElement.localName, 'body'); | 371 expect(bodyElement.localName, 'body'); |
| 372 // actual nodes | 372 // actual nodes |
| 373 expect(bodyElement.nodes, hasLength(4)); | 373 expect(bodyElement.nodes, hasLength(4)); |
| 374 expect((bodyElement.nodes[0] as Element).localName, 'div'); | 374 expect((bodyElement.nodes[0] as Element).localName, 'div'); |
| 375 expect((bodyElement.nodes[2] as Element).localName, 'span'); | 375 expect((bodyElement.nodes[2] as Element).localName, 'span'); |
| 376 } | 376 } |
| 377 // it's OK to don't have DOCTYPE | 377 // it's OK to don't have DOCTYPE |
| 378 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); | 378 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); |
| 379 } | 379 } |
| 380 } | 380 } |
| OLD | NEW |