|
|
Chromium Code Reviews|
Created:
4 years, 5 months ago by yoichio Modified:
4 years, 5 months ago Reviewers:
yosin_UTC9 CC:
blink-reviews, chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionImprove result comparing in assert_selection
That's because assert_selection often compares long HTML fragment.
TEST=Layouttests\editing\assert_selection.html
Committed: https://crrev.com/8466c81e38957bf0075c87e94403d963904492cd
Cr-Commit-Position: refs/heads/master@{#404801}
Patch Set 1 #
Total comments: 2
Patch Set 2 : update #
Total comments: 6
Patch Set 3 : update #
Total comments: 2
Patch Set 4 : update #
Messages
Total messages: 26 (10 generated)
Description was changed from ========== improve result compare in assert_selection BUG= ========== to ========== Improve result comparing in assert_selection That's because assert_selection often compares long HTML fragment. TEST=Layouttests\editing\assert_selection.html ==========
yoichio@chromium.org changed reviewers: + yosin@chromium.org
Good idea! https://codereview.chromium.org/2138653002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/editing/assert_selection.js:659: var comparedLength = Math.min(actualText.length, expectedText.length); Could you introduce mismatch(str1, str2) and mismatchLast(str1, str2) to cut both end?
https://codereview.chromium.org/2138653002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/editing/assert_selection.js:659: var comparedLength = Math.min(actualText.length, expectedText.length); On 2016/07/11 06:48:18, Yosi_UTC9 wrote: > Could you introduce mismatch(str1, str2) and mismatchLast(str1, str2) to cut > both end? Done.
https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:634: */ Please add @return {string} https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:637: var i = 0; nit: Since out of bound access of Array returns |undefined|, we could write: for (let index = 0; index < str1.length; ++index) { if (str1[index] !== str2[index]) return str1.substr(0, index); } return str1; Note: Use |let| instead of |var|
https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:635: function commonSubstr(str1, str2) { This function should be named |commonPrefixOf()| as it does. I actually want to have |CreateUnifiedDiff()| in gtest. Could you put TODO for this? I think it is good for intern project. ;-) https://cs.chromium.org/chromium/src/testing/gtest/src/gtest.cc?q=CreateUnifi... Yet, another option is https://en.wikipedia.org/wiki/Longest_common_substring_problem It is easier but diff version is more useful.
Patchset #4 (id:60001) has been deleted
Patchset #3 (id:40001) has been deleted
https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:634: */ On 2016/07/12 01:58:36, Yosi_UTC9 wrote: > Please add > @return {string} Done. https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:635: function commonSubstr(str1, str2) { On 2016/07/12 02:26:54, Yosi_UTC9 wrote: > This function should be named |commonPrefixOf()| as it does. > > I actually want to have |CreateUnifiedDiff()| in gtest. > Could you put TODO for this? I think it is good for intern project. ;-) > https://cs.chromium.org/chromium/src/testing/gtest/src/gtest.cc?q=CreateUnifi... > > Yet, another option is > https://en.wikipedia.org/wiki/Longest_common_substring_problem > > It is easier but diff version is more useful. > > Done. https://codereview.chromium.org/2138653002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:637: var i = 0; On 2016/07/12 01:58:36, Yosi_UTC9 wrote: > nit: Since out of bound access of Array returns |undefined|, > we could write: > > for (let index = 0; index < str1.length; ++index) { > if (str1[index] !== str2[index]) > return str1.substr(0, index); > } > return str1; > > Note: Use |let| instead of |var| Done.
lgtm https://codereview.chromium.org/2138653002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:670: sample.remove(); nit: early return is better.
https://codereview.chromium.org/2138653002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/assert_selection.js (right): https://codereview.chromium.org/2138653002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/assert_selection.js:670: sample.remove(); On 2016/07/12 04:15:12, Yosi_UTC9 wrote: > nit: early return is better. Done.
The CQ bit was checked by yoichio@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yosin@chromium.org Link to the patchset: https://codereview.chromium.org/2138653002/#ps100001 (title: "update")
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
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yosin@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Improve result comparing in assert_selection That's because assert_selection often compares long HTML fragment. TEST=Layouttests\editing\assert_selection.html ========== to ========== Improve result comparing in assert_selection That's because assert_selection often compares long HTML fragment. TEST=Layouttests\editing\assert_selection.html ==========
Message was sent while issue was closed.
Committed patchset #4 (id:100001)
Message was sent while issue was closed.
CQ bit was unchecked.
Message was sent while issue was closed.
Description was changed from ========== Improve result comparing in assert_selection That's because assert_selection often compares long HTML fragment. TEST=Layouttests\editing\assert_selection.html ========== to ========== Improve result comparing in assert_selection That's because assert_selection often compares long HTML fragment. TEST=Layouttests\editing\assert_selection.html Committed: https://crrev.com/8466c81e38957bf0075c87e94403d963904492cd Cr-Commit-Position: refs/heads/master@{#404801} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/8466c81e38957bf0075c87e94403d963904492cd Cr-Commit-Position: refs/heads/master@{#404801} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
