OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 html_cleaner_test; | 5 library html_cleaner_test; |
6 | 6 |
7 import 'package:html5lib/dom.dart'; | 7 import 'package:html5lib/dom.dart'; |
8 import 'package:html5lib/parser.dart'; | 8 import 'package:html5lib/parser.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 import 'package:unittest/vm_config.dart'; | 10 import 'package:unittest/vm_config.dart'; |
11 import 'package:web_components/src/html_cleaner.dart'; | 11 import 'package:web_ui/src/html_cleaner.dart'; |
12 import 'package:web_components/src/info.dart'; | 12 import 'package:web_ui/src/info.dart'; |
13 import 'package:web_components/src/files.dart'; | 13 import 'package:web_ui/src/files.dart'; |
14 import 'package:web_components/src/file_system/path.dart'; | 14 import 'package:web_ui/src/file_system/path.dart'; |
15 import 'testing.dart'; | 15 import 'testing.dart'; |
16 | 16 |
17 main() { | 17 main() { |
18 useVmConfiguration(); | 18 useVmConfiguration(); |
19 useMockMessages(); | 19 useMockMessages(); |
20 | 20 |
21 test('remove attributes with data bindings (1)', () { | 21 test('remove attributes with data bindings (1)', () { |
22 // Note: we use an id in all these tests so that the analyzer will not | 22 // Note: we use an id in all these tests so that the analyzer will not |
23 // inject one for us. | 23 // inject one for us. |
24 var elem = parseSubtree('<div foo="{{bar}}" id="a"></div>'); | 24 var elem = parseSubtree('<div foo="{{bar}}" id="a"></div>'); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 '<element name="x-bar" constructor="Bar42"></element>' | 82 '<element name="x-bar" constructor="Bar42"></element>' |
83 '</body></html>'; | 83 '</body></html>'; |
84 var doc = parse(input); | 84 var doc = parse(input); |
85 var file = new SourceFile(new Path('main.html'))..document = doc; | 85 var file = new SourceFile(new Path('main.html'))..document = doc; |
86 var info = analyzeFiles([file])['main.html']; | 86 var info = analyzeFiles([file])['main.html']; |
87 expect(doc.outerHTML, input); | 87 expect(doc.outerHTML, input); |
88 cleanHtmlNodes(info); | 88 cleanHtmlNodes(info); |
89 expect(doc.outerHTML, '<html><head></head><body></body></html>'); | 89 expect(doc.outerHTML, '<html><head></head><body></body></html>'); |
90 }); | 90 }); |
91 } | 91 } |
OLD | NEW |