Index: LayoutTests/fast/forms/input-select-webkit-user-select-none.html |
diff --git a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html |
index 4859ec9df10e0be4d22161ab21c8747d955b0166..9ef825843bd0c058bad3e5cd1dc9b1295ab2507e 100644 |
--- a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html |
+++ b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html |
@@ -1,26 +1,34 @@ |
-<html> |
<head> |
-<script> |
-function test() { |
- if (window.testRunner) |
- testRunner.dumpAsText(); |
- var tf = document.getElementById('tf'); |
- tf.select(); |
- if (tf.selectionStart == 0 && tf.selectionEnd == 0) { // ; |
- document.getElementById("result").innerHTML = "PASS"; |
- } else { |
- document.getElementById("result").innerHTML = "FAIL: selection start is " |
- + tf.selectionStart + " and end is " + tf.selectionEnd + "."; |
- } |
+<style> |
+#sample { |
+ -webkit-user-select: none; |
+ user-select: none; |
} |
-</script> |
+</style> |
</head> |
-<body onload="test()"> |
-<p> |
-Tests behavior of select() in case "-webkit-user-select: none" |
-attribute is specified to the input element. The field should not be selected. |
-</p> |
-<p><input type="text" id="tf" value="input text" style="-webkit-user-select: none"></input></p> |
-<p id="result">TEST NOT RUN YET</p> |
+<body> |
+<script src="../js/resources/js-test-pre.js"></script> |
+<div id="container"> |
+<p id="description"></p> |
+Manual step |
+<ol> |
+ <li>Click text input to focus it</li> |
+ <li>Hit Ctrl+A to select contents of text input</li> |
+</ol> |
+<input id="sample" value="foobar"> |
+</div> |
+<script> |
+description('Tests user-select:none doesn\'t affect select()'); |
+function $(id) { return document.getElementById(id); } |
+ |
+var sample = $('sample'); |
+sample.focus(); |
+sample.select(); |
+shouldBe('sample.selectionStart', '0'); |
+shouldBe('sample.selectionEnd', 'sample.value.length'); |
+ |
+if (window.testRunner) |
+ $('container').outerHTML = ''; |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |
</body> |
-</html> |