|
|
DescriptionAdd some more tests to InputMethodControllerTest
I'd originally written these tests to test new behavior in a CL where I'm
changing how DocumentMarkers get updated upon text replacements:
https://codereview.chromium.org/2692093003
@yosin suggested that I split off these tests into a separate CL so we can
record the current behavior to compare with the new behavior.
Review-Url: https://codereview.chromium.org/2721563005
Cr-Commit-Position: refs/heads/master@{#457667}
Committed: https://chromium.googlesource.com/chromium/src/+/309233eca481e1533a8ec3f80bef6c16d1116fb2
Patch Set 1 #
Total comments: 7
Patch Set 2 : Add separate WhitespaceFixup test, use EXPECT_STREQ, rename some tests #
Total comments: 1
Patch Set 3 : Give WhitespaceFixupAroundMarker tests more descriptive names #
Total comments: 3
Patch Set 4 : Add TODO and Marker_ prefix #Messages
Total messages: 43 (23 generated)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
rlanday@chromium.org changed reviewers: + yosin@chromium.org
rlanday@chromium.org changed required reviewers: + yosin@chromium.org
@yosin, I've split off the tests from https://codereview.chromium.org/2692093003 and modified them to have the current behavior as the expected results
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
xiaochengh@chromium.org changed reviewers: + xiaochengh@chromium.org
I have a question about 0xC2 https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1457: ASSERT_STREQ(" text ", div->innerHTML().utf8().data()); I prefer not checking precondition in a test. Instead, introduce a new test case for IMC fixing up whitespaces. https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1462: ASSERT_STREQ( Can we use EXPECT_STREQ to align with other tests? https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1492: "\xC2\xA0", // UTF-8 for an nbsp I'm wondering why we get '\xC2'... Shouldn't nbsp be just a '\xA0'? https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1592: TEST_F(InputMethodControllerTest, ReplaceBeforeAndAfterStartOfMarker) { "ReplaceTextContainsStartOfMarker" seems a better name. https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1641: TEST_F(InputMethodControllerTest, ReplaceBeforeAndAfterEndOfMarker) { "ReplaceTextContainsEndOfMarker" seems to be a better name.
https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1492: "\xC2\xA0", // UTF-8 for an nbsp On 2017/03/01 at 03:56:25, Xiaocheng wrote: > I'm wondering why we get '\xC2'... Shouldn't nbsp be just a '\xA0'? The Unicode code point is U+00A0. This is in the range U+0080 through U+07FF so it's a two-byte character in UTF-8. 0xC2 0xA0 is the UTF-8 encoding. http://www.fileformat.info/info/unicode/char/00a0/index.htm
https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1492: "\xC2\xA0", // UTF-8 for an nbsp On 2017/03/01 at 03:56:25, Xiaocheng wrote: > I'm wondering why we get '\xC2'... Shouldn't nbsp be just a '\xA0'? The Unicode code point is U+00A0. This is in the range U+0080 through U+07FF so it's a two-byte character in UTF-8. 0xC2 0xA0 is the UTF-8 encoding. http://www.fileformat.info/info/unicode/char/00a0/index.htm
https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1492: "\xC2\xA0", // UTF-8 for an nbsp On 2017/03/01 at 04:33:12, rlanday wrote: > On 2017/03/01 at 03:56:25, Xiaocheng wrote: > > I'm wondering why we get '\xC2'... Shouldn't nbsp be just a '\xA0'? > > The Unicode code point is U+00A0. This is in the range U+0080 through U+07FF so it's a two-byte character in UTF-8. 0xC2 0xA0 is the UTF-8 encoding. > > http://www.fileformat.info/info/unicode/char/00a0/index.htm I see. Thanks.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Updated
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
basically lgtm https://codereview.chromium.org/2721563005/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1486: TEST_F(InputMethodControllerTest, WhitespaceFixupAroundMarker2) { Sorry that I forgot about it last time. Please use more meaningful names other than just numbering them.
On 2017/03/01 at 21:32:10, xiaochengh wrote: > basically lgtm > > https://codereview.chromium.org/2721563005/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): > > https://codereview.chromium.org/2721563005/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1486: TEST_F(InputMethodControllerTest, WhitespaceFixupAroundMarker2) { > Sorry that I forgot about it last time. > > Please use more meaningful names other than just numbering them. Ok I've done that
The CQ bit was checked by rlanday@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from xiaochengh@chromium.org Link to the patchset: https://codereview.chromium.org/2721563005/#ps40001 (title: "Give WhitespaceFixupAroundMarker tests more descriptive names")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
All required reviewers (with asterisk prefixes) have not yet approved this CL. No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. Committers are members of the group "project-chromium-committers". Note that this has nothing to do with OWNERS files.
yosin@chromium.org changed reviewers: + changwan@chromium.org, yabinh@chromium.org
+changwang@, +yabinh@ for another eye.
non-owner lgtm with some nits. https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1478: How about adding one line: EXPECT_STREQ(" text ", div->innerHTML().utf8().data()); (Same in other tests.)
https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1478: On 2017/03/02 at 06:47:05, yabinh wrote: > How about adding one line: > EXPECT_STREQ(" text ", div->innerHTML().utf8().data()); > > (Same in other tests.) I suggested not checking precondition in PS1.
https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2721563005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1478: On 2017/03/02 20:24:31, Xiaocheng wrote: > On 2017/03/02 at 06:47:05, yabinh wrote: > > How about adding one line: > > EXPECT_STREQ(" text ", div->innerHTML().utf8().data()); > > > > (Same in other tests.) > > I suggested not checking precondition in PS1. Sorry I didn't notice that. But now I still prefer 1 test in Set1 to 2 tests in Set3. To me, it SEEMS that they are not equivalent (because of addMarker()), even though they actually are. That said, my l-g-t-m is still valid. I'm not going to be the blocker of this issue.
non-owner lgtm with nits 1) How about prefixing marker tests by putting Marker_ at the start of the names? 2) Is having multiple markers expected behavior here? I sometimes notice visually split underlines, and it looks weird. If this is not expected behavior, could we add TODOs to fix the behavior? I think test should not only explain the current behavior, but also represents the expected behavior (assuming this is not the right behavior, please kindly point to me the rationale of split markers if any).
On 2017/03/06 at 19:51:20, changwan wrote: > non-owner lgtm with nits > > 1) How about prefixing marker tests by putting Marker_ at the start of the names? > > 2) Is having multiple markers expected behavior here? I sometimes notice visually split underlines, and it looks weird. > If this is not expected behavior, could we add TODOs to fix the behavior? I think test should not only explain the current behavior, > but also represents the expected behavior (assuming this is not the right behavior, please kindly point to me the rationale of split markers if any). I don't know all the context behind why the markers currently get split, but I'm planning to change/fix it in https://codereview.chromium.org/2692093003
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Updated
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
rs lgtm Thanks for working this and reviewing!
The CQ bit was checked by rlanday@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from changwan@chromium.org, yabinh@chromium.org, xiaochengh@chromium.org Link to the patchset: https://codereview.chromium.org/2721563005/#ps60001 (title: "Add TODO and Marker_ prefix")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1489714915545380, "parent_rev": "d10bb36641de2636f34292c0e626a7202ff674bb", "commit_rev": "309233eca481e1533a8ec3f80bef6c16d1116fb2"}
Message was sent while issue was closed.
Description was changed from ========== Add some more tests to InputMethodControllerTest I'd originally written these tests to test new behavior in a CL where I'm changing how DocumentMarkers get updated upon text replacements: https://codereview.chromium.org/2692093003 @yosin suggested that I split off these tests into a separate CL so we can record the current behavior to compare with the new behavior. ========== to ========== Add some more tests to InputMethodControllerTest I'd originally written these tests to test new behavior in a CL where I'm changing how DocumentMarkers get updated upon text replacements: https://codereview.chromium.org/2692093003 @yosin suggested that I split off these tests into a separate CL so we can record the current behavior to compare with the new behavior. Review-Url: https://codereview.chromium.org/2721563005 Cr-Commit-Position: refs/heads/master@{#457667} Committed: https://chromium.googlesource.com/chromium/src/+/309233eca481e1533a8ec3f80bef... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/309233eca481e1533a8ec3f80bef... |