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

Unified Diff: tests/html/document_test.dart

Issue 17681003: Restore adoptNode and importNode to dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/document_test.dart
diff --git a/tests/html/document_test.dart b/tests/html/document_test.dart
index fece53edeb88ec190262a1557e2db16633a76591..ca04a0f96cedfd40362635985385535ef2a81d74 100644
--- a/tests/html/document_test.dart
+++ b/tests/html/document_test.dart
@@ -61,5 +61,24 @@ main() {
expect(new Element.tag('a'), isAnchorElement);
expect(new Element.tag('bad_name'), isUnknownElement);
});
+
+ test('adoptNode', () {
+ var div = new Element.html('<div><div id="foo">bar</div></div>');
+ var doc = document.implementation.createHtmlDocument('');
+ expect(doc.adoptNode(div), div);
+ expect(div.document, doc);
+ doc.body.nodes.add(div);
+ expect(doc.query('#foo').text, 'bar');
+ });
+
+ test('importNode', () {
+ var div = new Element.html('<div><div id="foo">bar</div></div>');
+ var doc = document.implementation.createHtmlDocument('');
+ var div2 = doc.importNode(div, true);
+ expect(div2, isNot(equals(div)));
+ expect(div2.document, doc);
+ doc.body.nodes.add(div2);
+ expect(doc.query('#foo').text, 'bar');
+ });
});
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698