| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 5 <script> |
| 6 // Regression tests for crbug.com/713607. |
| 7 |
| 8 test(() => { |
| 9 assert_exists(window, 'eventSender', 'This test requires eventSender'); |
| 10 |
| 11 assert_selection( |
| 12 [ |
| 13 '<textarea>^text|</textarea>', |
| 14 '<a href="http://www.example.com/">link</a>' |
| 15 ].join(''), |
| 16 selection => { |
| 17 const link = selection.document.querySelector('a'); |
| 18 link.focus(); |
| 19 eventSender.keyDown('ArrowLeft'); |
| 20 assert_equals(selection.document.activeElement, link); |
| 21 }, |
| 22 [ |
| 23 '|<textarea>text</textarea>', |
| 24 '<a href="http://www.example.com/">link</a>' |
| 25 ].join('')); |
| 26 }, 'Press left arrow key with unfocused selection in text control'); |
| 27 |
| 28 test(() => { |
| 29 assert_exists(window, 'eventSender', 'This test requires eventSender'); |
| 30 |
| 31 assert_selection( |
| 32 [ |
| 33 '<div contenteditable>^text|</div>', |
| 34 '<a href="http://www.example.com/">link</a>' |
| 35 ].join(''), |
| 36 selection => { |
| 37 const link = selection.document.querySelector('a'); |
| 38 link.focus(); |
| 39 eventSender.keyDown('ArrowLeft'); |
| 40 assert_equals(selection.document.activeElement, link); |
| 41 }, |
| 42 [ |
| 43 '<div contenteditable>^text|</div>', |
| 44 '<a href="http://www.example.com/">link</a>' |
| 45 ].join('')); |
| 46 }, 'Press left arrow key with unfocused selection in contenteditable div'); |
| 47 </script> |
| OLD | NEW |