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 @TestOn('browser') | 4 @TestOn('browser') |
5 library polymer_elements.test.iron_selector_exclude_local_names_test; | 5 library polymer_elements.test.iron_selector_exclude_local_names_test; |
6 | 6 |
7 import 'package:polymer_elements/iron_selector.dart'; | 7 import 'package:polymer_elements/iron_selector.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:web_components/web_components.dart'; | 9 import 'package:web_components/web_components.dart'; |
10 import 'common.dart'; | 10 import 'common.dart'; |
11 | 11 |
12 main() async { | 12 main() async { |
13 await initWebComponents(); | 13 await initWebComponents(); |
14 | 14 |
15 group('exclude local names', () { | 15 group('exclude local names', () { |
16 IronSelector test1; | 16 IronSelector test1; |
17 IronSelector test2; | 17 IronSelector test2; |
18 | 18 |
19 setUp(() { | 19 setUp(() { |
20 test1 = fixture('test1'); | 20 test1 = fixture('test1'); |
21 test2 = fixture('test2'); | 21 test2 = fixture('test2'); |
22 }); | 22 }); |
23 | 23 |
24 test('default `excludedLocalNames`', () { | 24 test('default `excludedLocalNames`', () { |
25 expect(test1.excludedLocalNames['template'], isNotNull); | 25 expect(test1.jsElement['_excludedLocalNames']['template'], isNotNull); |
Siggi Cherem (dart-lang)
2015/10/28 22:35:16
is this just private internal state or something u
jakemac
2015/10/29 16:07:29
This got moved to be a private variable. I guess t
| |
26 expect(test2.excludedLocalNames['template'], isNotNull); | 26 expect(test2.jsElement['_excludedLocalNames']['template'], isNotNull); |
27 }); | 27 }); |
28 | 28 |
29 test('custom `excludedLocalNames`', () { | 29 test('custom `excludedLocalNames`', () { |
30 test1.excludedLocalNames['foo'] = 1; | 30 test1.jsElement['_excludedLocalNames']['foo'] = 1; |
31 expect(test1.excludedLocalNames['foo'], isNotNull); | 31 expect(test1.jsElement['_excludedLocalNames']['foo'], isNotNull); |
32 expect(test2.excludedLocalNames['foo'], isNull); | 32 expect(test2.jsElement['_excludedLocalNames']['foo'], isNull); |
33 }); | 33 }); |
34 | 34 |
35 test('items', () { | 35 test('items', () { |
36 test1.excludedLocalNames['span'] = 1; | 36 test1.jsElement['_excludedLocalNames']['span'] = 1; |
37 test2.excludedLocalNames['div'] = 1; | 37 test2.jsElement['_excludedLocalNames']['div'] = 1; |
38 | 38 |
39 var NOT_FOUND = -1; | 39 var NOT_FOUND = -1; |
40 var items1 = test1.items.map((el) => el.localName); | 40 var items1 = test1.items.map((el) => el.localName); |
41 var items2 = test2.items.map((el) => el.localName); | 41 var items2 = test2.items.map((el) => el.localName); |
42 | 42 |
43 expect(items1.contains('span'), isFalse); | 43 expect(items1.contains('span'), isFalse); |
44 expect(items2.contains('div'), isFalse); | 44 expect(items2.contains('div'), isFalse); |
45 }); | 45 }); |
46 }); | 46 }); |
47 } | 47 } |
OLD | NEW |