New issue
Advanced search Search tips

Issue 828594 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

EditingTestBase should allow dumping serialized Range/EphemeralRange like SelectionTemplate

Project Member Reported by xiaoche...@chromium.org, Apr 3 2018

Issue description

In editing unit test code, we often need to examine whether a Range/EphemeralRange matches its expectation. Currently, the only way to serialize it is by converting it into a SelectionTemplate, like:

EphemeralRange actual_range = ...;
EXPECT_EQ(
    "<div>bla ^bla| bla</div>",
    GetSelectionTextFromBody(
        SelectionInDOMTree::Builder()
          .SetBaseAndExtent(actual_range)
          .Build()));

It's easier if we can do something like:

EphemeralRange actual_range = ...;
EXPECT_EQ(
    "<div>bla ^bla| bla</div>",
    GetRangeTextFromBody(actual_range));
 

Sign in to add a comment