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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/5354455-1.html

Issue 1455413002: Make some editing layout test files to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-19T12:41:19 Created 5 years, 1 month 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/LayoutTests/editing/selection/5354455-1-expected.txt » ('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>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
1 <p>This tests whether right clicking on a paragraph break in editable content se lects it. The break should be selected on OS X, but not on Windows or Unix. To run it manually, right click on the paragraph break after the first paragraph b elow.</p> 4 <p>This tests whether right clicking on a paragraph break in editable content se lects it. The break should be selected on OS X, but not on Windows or Unix. To run it manually, right click on the paragraph break after the first paragraph b elow.</p>
2 <div id="div" contenteditable="true"> 5 <div id="div" contenteditable="true">
3 <div><span id="text">The following paragraph break should be selected on OS X.</ span></div> 6 <div><span id="text">The following paragraph break should be selected on OS X.</ span></div>
4 <br> 7 <br>
5 </div> 8 </div>
6 <p>Mac: <span id="resultmac">RUNNING</span></p> 9 <div id="log"></div>
7 <p>Win: <span id="resultwin">RUNNING</span></p> 10 <script>
8 <p>Unix: <span id="resultunix">RUNNING</span></p> 11 function testIt(platform, expectedValue) {
9 <p>Android: <span id="resultandroid">RUNNING</span></p> 12 window.getSelection().removeAllRanges();
13 internals.settings.setAsynchronousSpellCheckingEnabled(true);
14 internals.settings.setEditingBehavior(platform);
10 15
11 <script>
12 function test(platform, result) {
13 window.getSelection().removeAllRanges();
14 internals.settings.setEditingBehavior(platform);
15
16 paragraph = document.getElementById("text"); 16 paragraph = document.getElementById("text");
17 x = paragraph.offsetParent.offsetLeft + paragraph.offsetLeft + paragraph.off setWidth + 10; 17 x = paragraph.offsetParent.offsetLeft + paragraph.offsetLeft + paragraph.off setWidth + 10;
18 y = paragraph.offsetParent.offsetTop + paragraph.offsetTop + paragraph.offse tHeight / 2; 18 y = paragraph.offsetParent.offsetTop + paragraph.offsetTop + paragraph.offse tHeight / 2;
19 eventSender.mouseMoveTo(x, y); 19 eventSender.mouseMoveTo(x, y);
20 // Give the editable region focus. 20 // Give the editable region focus.
21 eventSender.mouseDown(); 21 eventSender.mouseDown();
22 eventSender.mouseUp(); 22 eventSender.mouseUp();
23 // Right click on the paragraph break to select it. 23 // Right click on the paragraph break to select it.
24 eventSender.contextClick(); 24 eventSender.contextClick();
25 // esc key to kill the context menu. 25 // esc key to kill the context menu.
26 eventSender.keyDown("escape", null); 26 eventSender.keyDown("escape", null);
27 27 assert_equals(window.getSelection().type, expectedValue);
28 document.getElementById(result).innerHTML = window.getSelection().type;
29 } 28 }
30 29
31 if (window.eventSender && window.testRunner && window.internals) { 30 if (window.eventSender && window.testRunner && window.internals) {
32 testRunner.dumpAsText(); 31 test(testIt.bind(this, 'mac', 'Range'), 'mac');
33 32 test(testIt.bind(this, 'win', 'Caret'), 'win');
34 test('mac', 'resultmac'); 33 test(testIt.bind(this, 'unix', 'Caret'), 'unix');
35 test('win', 'resultwin'); 34 test(testIt.bind(this, 'android', 'Caret'), 'android');
36 test('unix', 'resultunix');
37 test('android', 'resultandroid');
38 } 35 }
39 </script> 36 </script>
40
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/selection/5354455-1-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698