[webkit-changes] cvs commit: LayoutTests/editing/selection
toString-expected.txt toString.html
Justin
justing at opensource.apple.com
Tue Jan 3 15:06:28 PST 2006
justing 06/01/03 15:06:28
Modified: . ChangeLog
Added: editing/selection toString-expected.txt toString.html
Log:
Reviewed by harrison
Layout test for:
<http://bugzilla.opendarwin.org/show_bug.cgi?id=4609>
window.getSelection().toString() is undefined (range object
returned from window.getSelection() is useless)
* editing/selection/toString-expected.txt: Added.
* editing/selection/toString.html: Added.
Revision Changes Path
1.218 +12 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -r1.217 -r1.218
--- ChangeLog 3 Jan 2006 23:03:35 -0000 1.217
+++ ChangeLog 3 Jan 2006 23:06:27 -0000 1.218
@@ -1,3 +1,15 @@
+2006-01-03 Justin Garcia <justin.garcia at apple.com>
+
+ Reviewed by harrison
+
+ Layout test for:
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=4609>
+ window.getSelection().toString() is undefined (range object
+ returned from window.getSelection() is useless)
+
+ * editing/selection/toString-expected.txt: Added.
+ * editing/selection/toString.html: Added.
+
2006-01-03 Eric Seidel <eseidel at apple.com>
Reviewed by darin.
1.1 LayoutTests/editing/selection/toString-expected.txt
Index: toString-expected.txt
===================================================================
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
This tests Selection::toString(): that it exists, that it returns the same result as the implicit toString call, and that it returns the correct results.
hello world
Success
1.1 LayoutTests/editing/selection/toString.html
Index: toString.html
===================================================================
<script>
function log(str) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
var console = document.getElementById("console");
console.appendChild(li);
}
function runTest() {
try {
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
var selection = window.getSelection();
var element = document.getElementById("test");
if (selection.setBaseAndExtent)
selection.setBaseAndExtent(element, 0, element, 1);
else if (selection.selectAllChildren)
selection.selectAllChildren(element);
else
throw("Couldn't set a selection.");
if (selection.toString) {
var string = selection.toString();
if (string != selection)
throw("Implicit toString call did not match explicit call");
if (string != "hello world")
throw("Selection::toString() returned incorrect results.");
log("Success");
} else
throw("Selection::toString() not supported");
} catch(e) {
log("Test Failed. Error was: " + e);
}
}
</script>
<body>
<p>This tests Selection::toString(): that it exists, that it returns the same result as the implicit toString call, and that it returns the correct results.</p>
<div id="test" style="border: 1px solid black;">hello world</div>
<ul id="console"></ul>
<script>runTest();</script>
</body>
More information about the webkit-changes
mailing list