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

Unified Diff: LayoutTests/editing/undo/undo-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-delete-boundary.html
diff --git a/LayoutTests/editing/undo/undo-delete-boundary.html b/LayoutTests/editing/undo/undo-delete-boundary.html
index daf92cab2a1459a13a4dcf1e489af56f918f66aa..5f920d8897935f1473c185bef394b775c9f4e45b 100644
--- a/LayoutTests/editing/undo/undo-delete-boundary.html
+++ b/LayoutTests/editing/undo/undo-delete-boundary.html
@@ -4,17 +4,17 @@
<div id="container">
<p id="description"></p>
<p>To test manually, place the cursor at the end of 'word' and delete it completely 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 at the end of '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').childNodes[1].firstChild; // Text node 'rd '
var selectionOffset = selectionNode.length - 1;
-var endNode = document.getElementById('test').firstChild; // Text node 'This wo'
-var endOffset = endNode.data.indexOf(' ') + 1;
+var endNodeMac = document.getElementById('test').firstChild; // Text node 'This wo'
+var endOffsetMac = endNodeMac.data.indexOf(' ') + 1;
var selection = window.getSelection();
function $(id) { return document.getElementById(id); }
@@ -37,10 +37,10 @@ function undoTest(platform, expectedStartNode, expectedStartOffset, expectedEndN
}
if (window.internals) {
- undoTest('mac', selectionNode, selectionOffset, endNode, endOffset, 'word');
- undoTest('win', selectionNode, selectionOffset, endNode, endOffset, 'word');
- undoTest('unix', selectionNode, selectionOffset, endNode, endOffset, 'word');
- undoTest('android', selectionNode, selectionOffset, endNode, endOffset, 'word');
+ undoTest('mac', selectionNode, selectionOffset, 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 = '';
« no previous file with comments | « LayoutTests/editing/undo/undo-delete.html ('k') | LayoutTests/editing/undo/undo-delete-boundary-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698