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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 const isMac = navigator.platform.indexOf('Mac') === 0;
7 const kDeleteWordModifiers = isMac ? ['altKey'] : ['ctrlKey'];
8
9 test(() => {
10 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.');
11 assert_selection(
12 [
13 '<div contenteditable>',
14 'one two |cha cha three four cha cha cha',
15 '</div>',
16 ].join(''),
17 selection => {
18 selection.document.execCommand('insertText', false, ' abc');
19 eventSender.keyDown('Backspace', kDeleteWordModifiers);
20 selection.document.execCommand('insertText', false, ' cha');
21 },
22 // BR is a placeholder.
23 [
24 '<div contenteditable>',
25 'one two \u{00A0}abc cha|cha cha three four cha cha cha',
26 '</div>',
27 ].join(''));
28 }, 'Delete word');
29
30 test(() => {
31 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.');
32 assert_selection(
33 [
34 '<div contenteditable>',
35 'one two |three four',
36 '</div>',
37 ].join(''),
38 selection => {
39 eventSender.keyDown('Backspace', kDeleteWordModifiers);
40 selection.document.execCommand('undo');
41 },
42 // BR is a placeholder.
43 [
44 '<div contenteditable>',
45 'one two |three four',
46 '</div>',
47 ].join(''));
48 }, 'Delete word then undo');
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698