Chromium Code Reviews| Index: LayoutTests/fast/forms/label/label-selection.html |
| diff --git a/LayoutTests/fast/forms/label/label-selection.html b/LayoutTests/fast/forms/label/label-selection.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e6bcd405e9f42521a6ef57af66585dfd9b76cb46 |
| --- /dev/null |
| +++ b/LayoutTests/fast/forms/label/label-selection.html |
| @@ -0,0 +1,33 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<script src="../../../resources/js-test.js"></script> |
| + |
| +<body> |
| +<label id="labelWithInput" for="inputText">Some Text associated with input</label> |
| +<input id="inputText" type="text"> |
| +</body> |
| + |
| +<script> |
| +description('Test the selection of label associated with input.'); |
| + |
| +if (window.testRunner) { |
| + testRunner.dumpAsText(); |
|
keishi
2014/05/02 08:48:35
Don't need this. This is done automatically in js-
deepak.sa
2014/05/02 12:55:31
Done.
|
| + |
| + var labelElement = document.getElementById('labelWithInput'); |
| + testWithDoubleClick(labelElement); |
| + |
| + shouldBeEqualToString('window.getSelection().toString()', 'Some'); |
| + |
| + labelElement.style.display = 'none'; |
| +} |
| + |
| +function testWithDoubleClick(element) |
| +{ |
| + eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| +} |
| +</script> |
| +</html> |