Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html b/third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..88910783e0e9ce431cdf329eb1c2f686a1a74dd1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html |
| @@ -0,0 +1,28 @@ |
| +<!DOCTYPE html> |
| +<body> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| + |
| +<input> |
| + |
| +<script> |
| +var t = async_test('selectionStart/selectionEnd should be kept after input type changes.'); |
| +t.step(() => { |
| + var element = document.querySelector('input'); |
|
yosin_UTC9
2017/05/12 04:03:52
nit: Please add: |assert_exists(window, 'eventSend
tkent
2017/05/12 08:41:07
Done.
|
| + element.value = ''; |
| + element.focus(); |
| + eventSender.keyDown('c'); |
| + assert_equals(element.selectionStart, 1); |
| + element.type = 'button'; |
| + assert_equals(element.selectionStart, null); |
| + element.type = 'text'; |
| + |
| + // TODO(tkent): We need some delay before checking selectionStart because |
| + // input type change doesn't update selectionStart immediately to avoid force |
| + // layout. crbug.com/721217 |
| + setTimeout(t.step_func_done(() => { |
|
yosin_UTC9
2017/05/12 04:03:52
nit: How about using t.step_timeout()[1]?
[1] "Ti
tkent
2017/05/12 08:41:07
Done.
|
| + assert_equals(element.selectionStart, 1); |
| + }), 1); |
| +}); |
| +</script> |
| +</body> |