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/test.dart'; |
14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
15 | 15 |
16 import '../../utils.dart'; | |
17 import '../context/abstract_context.dart'; | 16 import '../context/abstract_context.dart'; |
18 | 17 |
19 main() { | 18 main() { |
20 initializeTestEnvironment(); | |
21 defineReflectiveSuite(() { | 19 defineReflectiveSuite(() { |
22 defineReflectiveTests(DartScriptsTaskTest); | 20 defineReflectiveTests(DartScriptsTaskTest); |
23 defineReflectiveTests(HtmlErrorsTaskTest); | 21 defineReflectiveTests(HtmlErrorsTaskTest); |
24 defineReflectiveTests(ParseHtmlTaskTest); | 22 defineReflectiveTests(ParseHtmlTaskTest); |
25 }); | 23 }); |
26 } | 24 } |
27 | 25 |
28 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); | 26 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>(); |
29 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); | 27 isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>(); |
30 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); | 28 isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>(); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 expect(bodyElement.localName, 'body'); | 371 expect(bodyElement.localName, 'body'); |
374 // actual nodes | 372 // actual nodes |
375 expect(bodyElement.nodes, hasLength(4)); | 373 expect(bodyElement.nodes, hasLength(4)); |
376 expect((bodyElement.nodes[0] as Element).localName, 'div'); | 374 expect((bodyElement.nodes[0] as Element).localName, 'div'); |
377 expect((bodyElement.nodes[2] as Element).localName, 'span'); | 375 expect((bodyElement.nodes[2] as Element).localName, 'span'); |
378 } | 376 } |
379 // it's OK to don't have DOCTYPE | 377 // it's OK to don't have DOCTYPE |
380 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); | 378 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); |
381 } | 379 } |
382 } | 380 } |
OLD | NEW |