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

Unified Diff: LayoutTests/editing/undo/undo-combined-delete-boundary.html

Issue 43143003: Undo of delete/forward-delete of text should not select the deleted text on non-mac platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Function name modified and Tests/Expectations updated Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/undo/undo-combined-delete-boundary.html
diff --git a/LayoutTests/editing/undo/undo-combined-delete-boundary.html b/LayoutTests/editing/undo/undo-combined-delete-boundary.html
index d66c3a24f0f03b2f9987c629cd37e4f2bbe969ce..63549c2960599fe88fb1552b9ae06dbe2e6e4cfa 100644
--- a/LayoutTests/editing/undo/undo-combined-delete-boundary.html
+++ b/LayoutTests/editing/undo/undo-combined-delete-boundary.html
@@ -4,18 +4,18 @@
<div id="container">
<p id="description"></p>
<p>To test manually, place the cursor after 'o' in 'word' and delete it character by character. Do ctrl+z. On Mac, 'word' should be selected. On other platforms 'word' should not be selected and the cursor should be placed after 'o' in 'word'.</p>
-<div id="test" style="border: 2px solid red;" contenteditable>This wo<b>rd </b>should be selected.</div>
+<div id="test" style="border: 2px solid red;" contenteditable>This wo<b>rd </b>should be selected only on mac.</div>
</div>
<div id="console"></div>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script>
description('Verifies the selection behavior on undoing a text deletion.');
-var sampleHTML = 'This wo<b>rd </b>should be selected.';
+var sampleHTML = 'This wo<b>rd </b>should be selected only on mac.';
var selectionNode = document.getElementById('test').firstChild; // Text node 'This wo'
var selectionOffset = selectionNode.length;
-var endNode = document.getElementById('test').childNodes[1].firstChild; // Text node 'rd '
-var endOffset = endNode.length - 1;
-var startOffset = selectionNode.data.indexOf(' ')+1;
+var endNodeMac = document.getElementById('test').childNodes[1].firstChild; // Text node 'rd '
+var endOffsetMac = endNodeMac.length - 1;
+var startOffsetMac = selectionNode.data.indexOf(' ')+1;
var selection = window.getSelection();
function $(id) { return document.getElementById(id); }
@@ -40,10 +40,10 @@ function undoTest(platform, expectedStartNode, expectedStartOffset, expectedEndN
}
if (window.internals) {
- undoTest('mac', selectionNode, startOffset, endNode, endOffset, 'word');
- undoTest('win', selectionNode, startOffset, endNode, endOffset, 'word');
- undoTest('unix', selectionNode, startOffset, endNode, endOffset, 'word');
- undoTest('android', selectionNode, startOffset, endNode, endOffset, 'word');
+ undoTest('mac', selectionNode, startOffsetMac, endNodeMac, endOffsetMac, 'word');
+ undoTest('win', selectionNode, selectionOffset, selectionNode, selectionOffset, '');
+ undoTest('unix', selectionNode, selectionOffset, selectionNode, selectionOffset, '');
+ undoTest('android', selectionNode, selectionOffset, selectionNode, selectionOffset, '');
}
if (window.testRunner)
document.getElementById('container').outerHTML = '';

Powered by Google App Engine
This is Rietveld 408576698