| 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() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // work properly. This is blocked on having a good way to do browser | 59 // work properly. This is blocked on having a good way to do browser |
| 60 // rendering tests. | 60 // rendering tests. |
| 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 |
| 70 if (ShadowRoot.supported) { |
| 71 test('Shadowroot contents are distributed', () { |
| 72 |
| 73 var div = new DivElement(); |
| 74 |
| 75 var box1 = new DivElement() |
| 76 ..classes.add('foo'); |
| 77 div.append(box1); |
| 78 |
| 79 var box2 = new DivElement(); |
| 80 div.append(box2); |
| 81 |
| 82 var sRoot = div.createShadowRoot(); |
| 83 var content1 = new ContentElement() |
| 84 ..select = ".foo"; |
| 85 sRoot.append(content1); |
| 86 |
| 87 var content2 = new ContentElement(); |
| 88 sRoot.append(content2); |
| 89 |
| 90 expect(content1.getDistributedNodes(), [box1]); |
| 91 expect(content2.getDistributedNodes(), [box2]); |
| 92 }); |
| 93 } |
| 69 }); | 94 }); |
| 70 } | 95 } |
| OLD | NEW |