Introduce assert_selection() for editing tests (issue 2013603004 by yosin@chromium.org)

0 views
Skip to first unread message

yosin@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:04:54 AM5/26/16
to tk...@chromium.org, yoi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org
Reviewers: tkent, yoichio
CL: https://codereview.chromium.org/2013603004/

Message:
PTAL

Description:
Introduce assert_selection() for editing tests

This patch introduces |assert_selection()| function to help writing editing test
cases with W3C test harness.

Using |assert_selection()|, we can write test cases for execCommand as below:

assert_selection(
'<div conteneditable>^foo|</div>',
'createLink abc',
'<div conteneditable><a href="abc">foo</a></div>')

rather than sequence of |assert_equals()| for |Selection| and |innerHTML|.

More samples are found in crrev.com/2018463002

BUG=n/a
TEST=n/a; no behavior changes


Base URL: https://chromium.googlesource.com/chromium/src.git@master

Affected files (+637, -164 lines):
A third_party/WebKit/LayoutTests/editing/assert_selection.js
M third_party/WebKit/LayoutTests/editing/execCommand/createLink.html
D third_party/WebKit/LayoutTests/editing/execCommand/createLink-expected.txt
D third_party/WebKit/LayoutTests/platform/win/editing/execCommand/createLink-expected.txt


tk...@chromium.org

unread,
May 26, 2016, 4:23:14 AM5/26/16
to yo...@chromium.org, yoi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org
lgtm




https://codereview.chromium.org/2013603004/diff/20001/third_party/WebKit/LayoutTests/editing/assert_selection.js
File third_party/WebKit/LayoutTests/editing/assert_selection.js (right):

https://codereview.chromium.org/2013603004/diff/20001/third_party/WebKit/LayoutTests/editing/assert_selection.js#newcode338
third_party/WebKit/LayoutTests/editing/assert_selection.js:338: const
END_TAG_OMISSIBLE_NAMES = new Set(['br', 'hr', 'img', 'input', 'wbr']);
Can we refer to HTML5_VOID_ELEMENTS defined in
imported/wpt/html/resources/common.js ?

https://codereview.chromium.org/2013603004/

yosin@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:52:09 AM5/26/16
to tk...@chromium.org, yoi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org
Good to know.
I updated to use it.

https://codereview.chromium.org/2013603004/

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:52:25 AM5/26/16
to yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, commi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 5:11:48 AM5/26/16
to yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, commi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 6:28:24 AM5/26/16
to yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, commi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 7:29:25 AM5/26/16
to yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, commi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org
Committed patchset #6 (id:100001)

https://codereview.chromium.org/2013603004/

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 7:30:41 AM5/26/16
to yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, commi...@chromium.org, blink-...@chromium.org, chromium...@chromium.org
Patchset 6 (id:??) landed as
https://crrev.com/4af8b92817a88711cb2d42807badcf356a90efb7
Cr-Commit-Position: refs/heads/master@{#396161}

https://codereview.chromium.org/2013603004/
Reply all
Reply to author
Forward
0 new messages