| 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'; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 expect(outputs[HTML_ERRORS], isEmpty); | 258 expect(outputs[HTML_ERRORS], isEmpty); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| 262 @reflectiveTest | 262 @reflectiveTest |
| 263 class ParseHtmlTaskTest extends AbstractContextTest { | 263 class ParseHtmlTaskTest extends AbstractContextTest { |
| 264 test_buildInputs() { | 264 test_buildInputs() { |
| 265 Source source = newSource('/test.html'); | 265 Source source = newSource('/test.html'); |
| 266 Map<String, TaskInput> inputs = ParseHtmlTask.buildInputs(source); | 266 Map<String, TaskInput> inputs = ParseHtmlTask.buildInputs(source); |
| 267 expect(inputs, isNotNull); | 267 expect(inputs, isNotNull); |
| 268 expect(inputs.keys, unorderedEquals([ParseHtmlTask.CONTENT_INPUT_NAME])); | 268 expect( |
| 269 inputs.keys, |
| 270 unorderedEquals([ |
| 271 ParseHtmlTask.CONTENT_INPUT_NAME, |
| 272 ParseHtmlTask.MODIFICATION_TIME_INPUT |
| 273 ])); |
| 269 } | 274 } |
| 270 | 275 |
| 271 test_constructor() { | 276 test_constructor() { |
| 272 Source source = newSource('/test.html'); | 277 Source source = newSource('/test.html'); |
| 273 ParseHtmlTask task = new ParseHtmlTask(context, source); | 278 ParseHtmlTask task = new ParseHtmlTask(context, source); |
| 274 expect(task, isNotNull); | 279 expect(task, isNotNull); |
| 275 expect(task.context, context); | 280 expect(task.context, context); |
| 276 expect(task.target, source); | 281 expect(task.target, source); |
| 277 } | 282 } |
| 278 | 283 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 expect(bodyElement.localName, 'body'); | 371 expect(bodyElement.localName, 'body'); |
| 367 // actual nodes | 372 // actual nodes |
| 368 expect(bodyElement.nodes, hasLength(4)); | 373 expect(bodyElement.nodes, hasLength(4)); |
| 369 expect((bodyElement.nodes[0] as Element).localName, 'div'); | 374 expect((bodyElement.nodes[0] as Element).localName, 'div'); |
| 370 expect((bodyElement.nodes[2] as Element).localName, 'span'); | 375 expect((bodyElement.nodes[2] as Element).localName, 'span'); |
| 371 } | 376 } |
| 372 // it's OK to don't have DOCTYPE | 377 // it's OK to don't have DOCTYPE |
| 373 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); | 378 expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty); |
| 374 } | 379 } |
| 375 } | 380 } |
| OLD | NEW |