Avoid unnecessary sanity check
authorAryeh Gregor <ayg@aryeh.name>
Thu, 12 Jan 2012 11:47:00 -0700
changeset 690 f6680bdd77b4
parent 689 f4ad311eb645
child 691 51785ce8f38d
Avoid unnecessary sanity check

The point of Document-open.html is really that the selection should look
different. Opera shouldn't fail just because some selections that are
meant to look the same also look different.
selecttest/Document-open.html
--- a/selecttest/Document-open.html	Thu Jan 12 11:44:11 2012 -0700
+++ b/selecttest/Document-open.html	Thu Jan 12 11:47:00 2012 -0700
@@ -21,18 +21,16 @@
 		var originalSelection = iframe.contentWindow.getSelection();
 		assert_equals(originalSelection.rangeCount, 0,
 			"Sanity check: rangeCount must be initially 0");
-		assert_equals(iframe.contentWindow.getSelection(), originalSelection,
-			"Sanity check: getSelection() called twice must return the same object");
 		iframe.contentDocument.body.appendChild(
 			iframe.contentDocument.createTextNode("foo"));
 		var range = iframe.contentDocument.createRange();
 		range.selectNodeContents(iframe.contentDocument.body);
 		iframe.contentWindow.getSelection().addRange(range);
-		assert_equals(iframe.contentWindow.getSelection(), originalSelection,
-			"Sanity check: getSelection() called twice with addRange() in between must return the same object");
 		assert_equals(originalSelection.rangeCount, 1,
 			"Sanity check: rangeCount must be 1 after adding a range");
+
 		iframe.contentDocument.open();
+
 		assert_not_equals(iframe.contentWindow.getSelection(), originalSelection,
 			"After document.open(), the Selection object must no longer be the same");
 		assert_equals(iframe.contentWindow.getSelection().rangeCount, 0,