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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html

Issue 2177173002: Convert editing/inserting/insert-tab-00[1-4].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-25T18:11:29 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 test(() => assert_selection(
7 [
8 '<div contenteditable>',
9 '<span>|foo</span>',
10 '</div>',
11 ].join(''),
12 'insertText \t',
13 [
14 '<div contenteditable>',
15 '<span>',
16 '<span class="Apple-tab-span" style="white-space:pre">\t|</span> ',
17 'foo',
18 '</span>',
19 '</div>'
20 ].join('')),
21 'Insert a tab character before text');
22
23 test(() => assert_selection(
24 [
25 '<div contenteditable>',
26 '<span>foo|</span>',
27 '</div>',
28 ].join(''),
29 'insertText \t',
30 [
31 '<div contenteditable>',
32 '<span>',
33 'foo',
34 '<span class="Apple-tab-span" style="white-space:pre">\t|</span> ',
35 '</span>',
36 '</div>'
37 ].join('')),
38 'Insert a tab character after text');
39
40 test(() => assert_selection(
41 [
42 '<div contenteditable>',
43 '<span>fo|o</span>',
44 '</div>',
45 ].join(''),
46 'insertText \t',
47 [
48 '<div contenteditable>',
49 '<span>',
50 'fo',
51 '<span class="Apple-tab-span" style="white-space:pre">\t|</span> ',
52 'o',
53 '</span>',
54 '</div>'
55 ].join('')),
56 'Insert a tab character in text');
57
58 test(() => assert_selection(
59 [
60 '<div contenteditable>',
61 '<span>|foo</span>',
62 '</div>',
63 ].join(''),
64 selection => {
65 selection.document.execCommand('insertLineBreak');
66 selection.document.execCommand('insertText', false, '\t');
67 },
68 [
69 '<div contenteditable>',
70 '<span>',
71 '<br>',
72 '<span class="Apple-tab-span" style="white-space:pre">\t|</span> ',
73 'foo',
74 '</span>',
75 '</div>'
76 ].join('')),
77 'Insert BR and a tab character before text');
78 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698