Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: third_party/WebKit/LayoutTests/editing/assert_selection.html

Issue 2709473003: Add internals.textAffinity (Closed)
Patch Set: update Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="assert_selection.js"></script> 4 <script src="assert_selection.js"></script>
5 <script> 5 <script>
6 function checked_assert_selection(input, command, output) { 6 function checked_assert_selection(input, command, output) {
7 try { 7 try {
8 assert_selection(input, command, output); 8 assert_selection(input, command, output);
9 } catch (exception) { 9 } catch (exception) {
10 return exception.message; 10 return exception.message;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 {removeSampleIfSucceeded: true}); 306 {removeSampleIfSucceeded: true});
307 assert_equals(sample2.iframe_.parentNode, null, 307 assert_equals(sample2.iframe_.parentNode, null,
308 'removeSampleIfSucceeded: true'); 308 'removeSampleIfSucceeded: true');
309 309
310 const sample3 = assert_selection('abc', '', 'abc'); 310 const sample3 = assert_selection('abc', '', 'abc');
311 assert_equals(sample3.iframe_.parentNode, null, 'with default options'); 311 assert_equals(sample3.iframe_.parentNode, null, 'with default options');
312 312
313 const sample4 = assert_selection('abc', '', 'abc', 'description'); 313 const sample4 = assert_selection('abc', '', 'abc', 'description');
314 assert_equals(sample4.iframe_.parentNode, null, 'with description'); 314 assert_equals(sample4.iframe_.parentNode, null, 'with description');
315 }, 'removeSampleIfSucceeded'); 315 }, 'removeSampleIfSucceeded');
316
317 test(() => {
318 assert_exists(window, 'internals');
319 assert_exists(window, 'eventSender');
320 assert_selection(
321 'foo|bar',
322 () => { assert_equals(internals.textAffinity, 'Downstream'); },
323 'foo|bar');
324 assert_selection(
325 '<div contenteditable style="width: 25px;">foobar</div>',
326 selection => {
327 eventSender.dragMode = false;
328 var document = selection.document;
329 var div = document.querySelector('div');
330 eventSender.mouseMoveTo(document.offsetLeft + div.offsetLeft + 20,
331 document.offsetTop + div.offsetTop + 5);
332 eventSender.mouseDown();
333 eventSender.mouseUp();
334 assert_equals(internals.textAffinity, 'Upstream'); },
335 '<div contenteditable style="width: 25px;">foo|bar</div>');
336 }, 'Textaffinity');
316 </script> 337 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698