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

Unified Diff: LayoutTests/fast/dom/Range/range-constructor.html

Issue 14904005: Make Range constructable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update expectations 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/Range/range-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Range/range-constructor.html
diff --git a/LayoutTests/fast/dom/Range/range-constructor.html b/LayoutTests/fast/dom/Range/range-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..9faffcd89885db55fd8cfdc312282bd21c8ec4d5
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/range-constructor.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../../js/resources/js-test-pre.js"></script>
+<div id="test-div">Test</div>
+<script>
+
+description('Tests that we can create instances of Range using new');
+
+shouldBe('typeof new Range', '"object"');
+shouldBe('Object.prototype.toString.call(new Range)', '"[object Range]"');
+shouldBeTrue('new Range instanceof Range');
+shouldBe('Object.getPrototypeOf(new Range)', 'Range.prototype');
+
+var r = new Range();
+r.selectNodeContents(document.getElementById('test-div'));
+shouldBe('r.toString()', '"Test"')
+
+var frame = document.createElement('iframe');
+document.body.appendChild(frame);
+var innerWindow = frame.contentWindow;
+var innerDocument = frame.contentDocument;
+innerDocument.body.textContent = 'Inner';
+
+shouldBeTrue('new innerWindow.Range instanceof innerWindow.Range');
+shouldBe('Object.getPrototypeOf(new innerWindow.Range)', 'innerWindow.Range.prototype');
+
+var r = new innerWindow.Range();
+r.selectNodeContents(innerDocument.body);
+shouldBe('r.toString()', '"Inner"');
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/range-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698