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

Unified Diff: LayoutTests/fast/dom/Comment/comment-constructor.html

Issue 14931009: Make Comment constructable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 7 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 | « no previous file | LayoutTests/fast/dom/Comment/comment-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Comment/comment-constructor.html
diff --git a/LayoutTests/fast/dom/Comment/comment-constructor.html b/LayoutTests/fast/dom/Comment/comment-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..9e92bbea61a0834b56604a272bce555a589dcb22
--- /dev/null
+++ b/LayoutTests/fast/dom/Comment/comment-constructor.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script>
+
+description('This tests that Comment is constructable.');
+
+shouldBe('new Comment("one").data', '"one"');
+shouldBe('new Comment().data', '""');
+shouldBe('new Comment("two").ownerDocument', 'document');
+
+shouldBe('typeof new Comment', '"object"');
+shouldBe('Object.prototype.toString.call(new Comment)', '"[object Comment]"');
+shouldBeTrue('new Comment instanceof Comment');
+shouldBe('Object.getPrototypeOf(new Comment)', 'Comment.prototype');
+
+var frame = document.createElement('iframe');
+document.body.appendChild(frame);
+var innerWindow = frame.contentWindow;
+var innerDocument = frame.contentDocument;
+
+shouldBe('new innerWindow.Comment("three").ownerDocument', 'innerDocument')
+shouldBeTrue('new innerWindow.Comment instanceof innerWindow.Comment');
+shouldBe('Object.getPrototypeOf(new innerWindow.Comment)', 'innerWindow.Comment.prototype');
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Comment/comment-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698