| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 ShadowDOMTest; | 5 library ShadowDOMTest; |
| 6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| 11 useHtmlIndividualConfiguration(); | 11 useHtmlIndividualConfiguration(); |
| 12 | 12 |
| 13 group('supported', () { | 13 group('supported', () { |
| 14 test('supported', () { | 14 test('supported', () { |
| 15 expect(ShadowRoot.supported, true); | 15 expect(ShadowRoot.supported, true); |
| 16 }); | 16 }); |
| 17 }); | 17 }); |
| 18 | 18 |
| 19 group('ShadowDOM tests', () { | 19 group('ShadowDOM_tests', () { |
| 20 | 20 |
| 21 var div1, div2, shadowRoot, paragraph1, paragraph2; | 21 var div1, div2, shadowRoot, paragraph1, paragraph2; |
| 22 | 22 |
| 23 init() { | 23 init() { |
| 24 paragraph1 = new ParagraphElement(); | 24 paragraph1 = new ParagraphElement(); |
| 25 paragraph2 = new ParagraphElement(); | 25 paragraph2 = new ParagraphElement(); |
| 26 [paragraph1, paragraph2].forEach((p) { p.classes.add('foo');}); | 26 [paragraph1, paragraph2].forEach((p) { p.classes.add('foo');}); |
| 27 div1 = new DivElement(); | 27 div1 = new DivElement(); |
| 28 div2 = new DivElement(); | 28 div2 = new DivElement(); |
| 29 div1.classes.add('foo'); | 29 div1.classes.add('foo'); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 test('Querying in shadowed fragment respects the shadow boundary.', () { | 62 test('Querying in shadowed fragment respects the shadow boundary.', () { |
| 63 expect(() { | 63 expect(() { |
| 64 init(); | 64 init(); |
| 65 | 65 |
| 66 expect(shadowRoot.queryAll('.foo'), equals([paragraph1])); | 66 expect(shadowRoot.queryAll('.foo'), equals([paragraph1])); |
| 67 }, expectation); | 67 }, expectation); |
| 68 }); | 68 }); |
| 69 }); | 69 }); |
| 70 } | 70 } |
| OLD | NEW |