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

Review-Url: https://codereview.chromium.org/2013603004
Cr-Commit-Position: refs/heads/master@{#396161}
4 files changed