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

Unified Diff: third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html

Issue 2252153004: Convert editing/delete-by-word-00[12].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-18T16:31:46 Created 4 years, 4 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: third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
diff --git a/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html b/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
new file mode 100644
index 0000000000000000000000000000000000000000..f58963051c559aa19bf6e771d36d7134cf0ec94b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
@@ -0,0 +1,49 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+ const isMac = navigator.platform.indexOf('Mac') === 0;
+ const kDeleteWordModifiers = isMac ? ['altKey'] : ['ctrlKey'];
+
+ test(() => {
+ assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
+ assert_selection(
+ [
+ '<div contenteditable>',
+ 'one two |cha cha three four cha cha cha',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('insertText', false, ' abc');
+ eventSender.keyDown('Backspace', kDeleteWordModifiers);
+ selection.document.execCommand('insertText', false, ' cha');
+ },
+ // BR is a placeholder.
+ [
+ '<div contenteditable>',
+ 'one two \u{00A0}abc cha|cha cha three four cha cha cha',
+ '</div>',
+ ].join(''));
+ }, 'Delete word');
+
+ test(() => {
+ assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
+ assert_selection(
+ [
+ '<div contenteditable>',
+ 'one two |three four',
+ '</div>',
+ ].join(''),
+ selection => {
+ eventSender.keyDown('Backspace', kDeleteWordModifiers);
+ selection.document.execCommand('undo');
+ },
+ // BR is a placeholder.
+ [
+ '<div contenteditable>',
+ 'one two |three four',
+ '</div>',
+ ].join(''));
+ }, 'Delete word then undo');
+</script>

Powered by Google App Engine
This is Rietveld 408576698