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 /** Common definitions used for setting up the test environment. */ | 5 /** Common definitions used for setting up the test environment. */ |
6 library testing; | 6 library testing; |
7 | 7 |
8 import 'package:html5lib/dom.dart'; | 8 import 'package:html5lib/dom.dart'; |
9 import 'package:html5lib/html5parser.dart'; | 9 import 'package:html5lib/parser.dart'; |
10 import 'package:web_components/src/template/world.dart'; | 10 import 'package:web_components/src/template/world.dart'; |
11 | 11 |
12 // TODO(jmesserly): we need tests for warnings from the analyzer. | 12 // TODO(jmesserly): we need tests for warnings from the analyzer. |
13 class MockWorld extends World { | 13 class MockWorld extends World { |
14 MockWorld() : super(null); | 14 MockWorld() : super(null); |
15 warning(message, [span, span1, span2]) {} | 15 warning(message, [span, span1, span2]) {} |
16 error(message, [span, span1, span2]) {} | 16 error(message, [span, span1, span2]) {} |
17 } | 17 } |
18 | 18 |
19 useMockWorld() { | 19 useMockWorld() { |
20 // TODO(jmesserly): fix the warning system to not need this. | 20 // TODO(jmesserly): fix the warning system to not need this. |
21 world = new MockWorld(); | 21 world = new MockWorld(); |
22 } | 22 } |
23 | 23 |
24 Element parseSubtree(String html) => parseFragment(html).nodes[0]; | 24 Element parseSubtree(String html) => parseFragment(html).nodes[0]; |
OLD | NEW |