Cleaning up shadow dom tests.
Made the standard test check for platform support and expect a failure if not supported. Made the layout test fail if not supported rather than hang and cleaned up the status file for it. BUG= Review URL: https://codereview.chromium.org//11614032 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16291 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -54,8 +54,6 @@ documentfragment_test: Pass, Timeout
|
||||
[ $runtime == ie9 || $runtime == ie10 || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera ]
|
||||
# TODO(vsm): Triage DOM tests.
|
||||
htmloptionscollection_test: Fail # Issue 3813.
|
||||
shadow_dom_test: Skip # No ShadowDOM support except on tip dartium.
|
||||
shadow_dom_layout_test: Skip
|
||||
unknownelement_test: Fail # Issue 4189
|
||||
|
||||
[ $runtime == dartium || $runtime == chrome || $runtime == ie9 || $runtime == ie10 || $runtime == safari || $runtime == ff || $runtime == opera ]
|
||||
@@ -92,6 +90,7 @@ measurement_test: Fail, Pass
|
||||
messageevent_test: Fail
|
||||
mutationobserver_test: Fail
|
||||
serialized_script_value_test: Fail
|
||||
shadow_dom_layout_test: Fail # IE10 does not support shadow root.
|
||||
storage_test: Fail, Pass
|
||||
svgelement_test/additionalConstructors: Fail
|
||||
svgelement_test/elementset: Fail
|
||||
@@ -157,8 +156,7 @@ messageevent_test: Fail
|
||||
mutationobserver_test: Fail
|
||||
postmessage_structured_test: Skip # BUG(5685): times out.
|
||||
serialized_script_value_test: Fail
|
||||
shadow_dom_layout_test: Fail
|
||||
shadow_dom_test: Fail
|
||||
shadow_dom_layout_test: Fail # IE9 does not support shadow root.
|
||||
storage_test: Fail
|
||||
svg_3_test: Fail
|
||||
svgelement_test/additionalConstructors: Fail
|
||||
@@ -176,6 +174,8 @@ xhr_test: Skip # BUG(4016)
|
||||
xhr_cross_origin_test: Fail # Issue 6016.
|
||||
|
||||
[ $runtime == safari ]
|
||||
# TODO(efortuna): Make our test framework able to separate tests out by browser
|
||||
# version.
|
||||
# TODO(ahe, efortuna): These tests need to be retriaged now that we're testing
|
||||
# with Safari 6.
|
||||
audiocontext_test: Crash, Fail # Issue: 7414
|
||||
@@ -195,10 +195,8 @@ input_element_test/week: Fail, Crash # Safari does not support this input ty
|
||||
fileapi_test: Fail # requestFileSystem not supported in Safari 6.
|
||||
datalistelement_test: Fail # HTMLDataListElement not yet supported in Safari.
|
||||
contentelement_test: Fail # Safari 6 does not support content element.
|
||||
# TODO(efortuna): Make our test framework able to separate tests out by browser
|
||||
# version.
|
||||
datalistelement_test: Fail # Issue: 7414
|
||||
node_test: Skip # Issue 6457
|
||||
shadow_dom_layout_test: Fail # Safari does not support shadow root.
|
||||
|
||||
[ $runtime == opera && $system == windows ]
|
||||
htmlelement_test: Fail, Pass
|
||||
@@ -239,6 +237,7 @@ indexeddb_4_test: Fail
|
||||
mutationobserver_test: Fail
|
||||
performance_api_test: Fail
|
||||
serialized_script_value_test: Fail
|
||||
shadow_dom_layout_test: Fail # Opera does not support shadow root.
|
||||
svg_3_test: Fail
|
||||
svgelement_test/additionalConstructors: Fail
|
||||
svgelement2_test: Fail
|
||||
@@ -277,6 +276,7 @@ input_element_test/month: Fail # FF does not support this input type.
|
||||
input_element_test/time: Fail # FF does not support this input type.
|
||||
input_element_test/week: Fail # FF does not support this input type.
|
||||
input_element_test/range: Fail # FF does not support this input type.
|
||||
shadow_dom_layout_test: Fail # FF does not support shadow root.
|
||||
# Interfaces not implemented: SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable
|
||||
svg_3_test: Fail
|
||||
svgelement_test/additionalConstructors: Fail
|
||||
|
||||
@@ -20,10 +20,15 @@ main() {
|
||||
var greenbox = _colorBox('green', 60, 10);
|
||||
|
||||
// assemble DOM
|
||||
var sRoot = new ShadowRoot(div);
|
||||
sRoot.nodes.add(new Element.html('<content select=".foo"></content>'));
|
||||
sRoot.nodes.add(redbox);
|
||||
sRoot.nodes.add(new Element.tag('content'));
|
||||
try {
|
||||
var sRoot = new ShadowRoot(div);
|
||||
sRoot.nodes.add(new Element.html('<content select=".foo"></content>'));
|
||||
sRoot.nodes.add(redbox);
|
||||
sRoot.nodes.add(new Element.tag('content'));
|
||||
catch () {
|
||||
// Shadow Root may not be supported and throw an exception.
|
||||
// Catch and continue to fail the test rather than hang.
|
||||
}
|
||||
|
||||
div.nodes.add(bluebox);
|
||||
div.nodes.add(greenbox);
|
||||
|
||||
@@ -14,7 +14,7 @@ main() {
|
||||
|
||||
var div1, div2, shadowRoot, paragraph1, paragraph2;
|
||||
|
||||
setUp(() {
|
||||
void init() {
|
||||
paragraph1 = new ParagraphElement();
|
||||
paragraph2 = new ParagraphElement();
|
||||
[paragraph1, paragraph2].forEach((p) { p.classes.add('foo');});
|
||||
@@ -29,14 +29,24 @@ main() {
|
||||
div2.nodes.add(paragraph2);
|
||||
document.body.nodes.add(div1);
|
||||
document.body.nodes.add(div2);
|
||||
});
|
||||
}
|
||||
|
||||
var expectation = ShadowRoot.supported ? returnsNormally : throws;
|
||||
|
||||
test("Shadowed nodes aren't visible to queries from outside ShadowDOM", () {
|
||||
expect(queryAll('.foo'), equals([div1, paragraph2]));
|
||||
expect(() {
|
||||
init();
|
||||
|
||||
expect(queryAll('.foo'), equals([div1, paragraph2]));
|
||||
}, expectation);
|
||||
});
|
||||
|
||||
test('Parent node of a shadow root must be null.', () {
|
||||
expect(shadowRoot.parent, isNull);
|
||||
expect(() {
|
||||
init();
|
||||
|
||||
expect(shadowRoot.parent, isNull);
|
||||
}, expectation);
|
||||
});
|
||||
|
||||
|
||||
@@ -46,7 +56,11 @@ main() {
|
||||
// rendering tests.
|
||||
|
||||
test('Querying in shadowed fragment respects the shadow boundary.', () {
|
||||
expect(shadowRoot.queryAll('.foo'), equals([paragraph1]));
|
||||
expect(() {
|
||||
init();
|
||||
|
||||
expect(shadowRoot.queryAll('.foo'), equals([paragraph1]));
|
||||
}, expectation);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user