Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: tests/html/shadow_dom_test.dart

Issue 10661039: added preliminary ShadowDOM tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #library('ShadowDOMTest');
6 #import('../../lib/unittest/unittest.dart');
7 #import('../../lib/unittest/html_config.dart');
8 #import('dart:html');
9
10 main() {
11 useHtmlConfiguration();
12
13 group('ShadowDOM tests', () {
14
15 var div1, div2, shadowRoot, paragraph1, paragraph2;
16
17 setUp(() {
18 paragraph1 = new ParagraphElement();
19 paragraph2 = new ParagraphElement();
20 [paragraph1, paragraph2].forEach( (p) { p.classes.add('foo');});
Siggi Cherem (dart-lang) 2012/06/26 23:10:49 remove space between ( (
samhop 2012/06/26 23:16:30 Done.
21 div1 = new DivElement();
22 div2 = new DivElement();
23 div1.classes.add('foo');
24 shadowRoot = new ShadowRoot(div2);
25 shadowRoot.nodes.add(paragraph1);
26 // No constructor for ContentElement exists yet.
27 // See http://code.google.com/p/dart/issues/detail?id=3870.
28 shadowRoot.nodes.add(new Element.tag('content'));
29 div2.nodes.add(paragraph2);
30 document.body.nodes.add(div1);
31 document.body.nodes.add(div2);
32 });
33
34 test("Shadowed nodes aren't visible to queries from outside ShadowDOM", () {
35 expect(queryAll('.foo'), equals([div1, paragraph2]));
36 });
37
38 test('Parent node of a shadow root must be null.', () {
39 expect(shadowRoot.parent, isNull);
40 });
41
42
43 // TODO(samhop): test that <content> and <content select="foo"> and
44 // <shadow>
45 // work properly. This is blocked on having a good way to do browser
46 // rendering tests.
47
48 test('Querying in shadowed fragment respects the shadow boundary.', () {
49 expect(shadowRoot.queryAll('.foo'), equals([paragraph1]));
50 });
51 });
52 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698