|
|
Chromium Code Reviews|
Created:
4 years, 5 months ago by yosin_UTC9 Modified:
4 years, 5 months ago Reviewers:
yoichio 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. |
DescriptionConvert editing/deleting/delete-ligature-003.html to use w3c test harness
This patch converts "editing/deleting/delete-ligature-003.html" to use
w3c test harness to simplify the code for improving code health.
BUG=n/a
TEST=LayoutTests/editing/deleting/delete-ligature-003.html
Committed: https://crrev.com/ae25071e06a278c9b54bf850689422180f85a701
Cr-Commit-Position: refs/heads/master@{#406798}
Patch Set 1 : 2016-07-20T13:58:12 #Patch Set 2 : 2016-07-20T16:09:25 #Patch Set 3 : 2016-07-20T16:37:01 #
Total comments: 5
Patch Set 4 : 2016-07-21T11:16:53 #
Messages
Total messages: 27 (18 generated)
The CQ bit was checked by yosin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== 2016-07-20T13:58:12 BUG= ========== to ========== Convert editing/deleting/delete-ligature-003.html to use w3c test harness This patch converts "editing/deleting/delete-ligature-003.html" to use w3c test harness to simplify the code for improving code health. BUG=n/a TEST=LayoutTests/editing/deleting/delete-ligature-003.html ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yosin@chromium.org to run a CQ dry run
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 checked by yosin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
yosin@chromium.org changed reviewers: + yoichio@chromium.org
PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html (right): https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:11: 'This test requires window.internals'); You can put these asserts out of forEach https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:20: platform === 'mac' if mac is special case, could you make another assert_selection for mac?
The CQ bit was checked by yosin@chromium.org to run a CQ dry run
PTAL https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html (right): https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:11: 'This test requires window.internals'); On 2016/07/21 at 01:49:17, yoichio wrote: > You can put these asserts out of forEach Done. https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:20: platform === 'mac' On 2016/07/21 at 01:49:17, yoichio wrote: > if mac is special case, could you make another assert_selection > for mac? I don't think it is worth to do. If we move "mac" to another assertion it could write as: function testIt(platform, expectedResult) { assert_selection( '<div contenteditable>\u0E27\u0E31|</div>', selection => { internals.settings.setEditingBehavior(platform); selection.document.defaultView.focus(); eventSender.keyDown('Backspace', null); selection.document.execCommand('undo'); }, expectedResult, `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`); } ['win', 'unix', 'android'].forEach(platform => testIt(platform, '<div contenteditable>\u0E27\u0E31|</div>'); testIt('mac', '<div contenteditable>\u0E27|\u0E31^</div>'); CONS are: - expected result is specified far from input and action. - testIt() introduces one additional step to read code. "platform === 'mac' ? expecationOfMac : expecationOfOther" is more concise and easier to read.
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: 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_...)
https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html (right): https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:20: platform === 'mac' On 2016/07/21 02:20:23, Yosi_UTC9 wrote: > On 2016/07/21 at 01:49:17, yoichio wrote: > > if mac is special case, could you make another assert_selection > > for mac? > > I don't think it is worth to do. > > If we move "mac" to another assertion it could write as: > function testIt(platform, expectedResult) > { > assert_selection( > '<div contenteditable>\u0E27\u0E31|</div>', > selection => { > internals.settings.setEditingBehavior(platform); > selection.document.defaultView.focus(); > eventSender.keyDown('Backspace', null); > selection.document.execCommand('undo'); > }, > expectedResult, > `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`); > } > > ['win', 'unix', 'android'].forEach(platform => > testIt(platform, '<div contenteditable>\u0E27\u0E31|</div>'); > testIt('mac', '<div contenteditable>\u0E27|\u0E31^</div>'); > > CONS are: > - expected result is specified far from input and action. > - testIt() introduces one additional step to read code. > > "platform === 'mac' ? expecationOfMac : expecationOfOther" is more concise and > easier to read. > I just suggest ['win', 'unix', 'android'].forEach( assert_selection( '<div contenteditable>\u0E27\u0E31|</div>', selection => { internals.settings.setEditingBehavior(platform); selection.document.defaultView.focus(); eventSender.keyDown('Backspace', null); selection.document.execCommand('undo'); }, '<div contenteditable>\u0E27\u0E31|</div>', `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`); assert_selection( '<div contenteditable>\u0E27\u0E31|</div>', selection => { internals.settings.setEditingBehavior('mac'); selection.document.defaultView.focus(); eventSender.keyDown('Backspace', null); selection.document.execCommand('undo'); }, '<div contenteditable>\u0E27|\u0E31</div>',
On 2016/07/21 at 04:52:11, yoichio wrote: > https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... > File third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html (right): > > https://codereview.chromium.org/2163163002/diff/40001/third_party/WebKit/Layo... > third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html:20: platform === 'mac' > On 2016/07/21 02:20:23, Yosi_UTC9 wrote: > > On 2016/07/21 at 01:49:17, yoichio wrote: > > > if mac is special case, could you make another assert_selection > > > for mac? > > > > I don't think it is worth to do. > > > > If we move "mac" to another assertion it could write as: > > function testIt(platform, expectedResult) > > { > > assert_selection( > > '<div contenteditable>\u0E27\u0E31|</div>', > > selection => { > > internals.settings.setEditingBehavior(platform); > > selection.document.defaultView.focus(); > > eventSender.keyDown('Backspace', null); > > selection.document.execCommand('undo'); > > }, > > expectedResult, > > `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`); > > } > > > > ['win', 'unix', 'android'].forEach(platform => > > testIt(platform, '<div contenteditable>\u0E27\u0E31|</div>'); > > testIt('mac', '<div contenteditable>\u0E27|\u0E31^</div>'); > > > > CONS are: > > - expected result is specified far from input and action. > > - testIt() introduces one additional step to read code. > > > > "platform === 'mac' ? expecationOfMac : expecationOfOther" is more concise and > > easier to read. > > > I just suggest > ['win', 'unix', 'android'].forEach( assert_selection( > '<div contenteditable>\u0E27\u0E31|</div>', > selection => { > internals.settings.setEditingBehavior(platform); > selection.document.defaultView.focus(); > eventSender.keyDown('Backspace', null); > selection.document.execCommand('undo'); > }, > '<div contenteditable>\u0E27\u0E31|</div>', > `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`); > > assert_selection( > '<div contenteditable>\u0E27\u0E31|</div>', > selection => { > internals.settings.setEditingBehavior('mac'); > selection.document.defaultView.focus(); > eventSender.keyDown('Backspace', null); > selection.document.execCommand('undo'); > }, > '<div contenteditable>\u0E27|\u0E31</div>', We should avoid copy-paste in the code. When we do your suggestion, it is confusing and hard to maintain. When this test is failed in the future, we need to compare both input and actions then we realize both inputs and sample are same but result is different.
lgtm
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.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Convert editing/deleting/delete-ligature-003.html to use w3c test harness This patch converts "editing/deleting/delete-ligature-003.html" to use w3c test harness to simplify the code for improving code health. BUG=n/a TEST=LayoutTests/editing/deleting/delete-ligature-003.html ========== to ========== Convert editing/deleting/delete-ligature-003.html to use w3c test harness This patch converts "editing/deleting/delete-ligature-003.html" to use w3c test harness to simplify the code for improving code health. BUG=n/a TEST=LayoutTests/editing/deleting/delete-ligature-003.html Committed: https://crrev.com/ae25071e06a278c9b54bf850689422180f85a701 Cr-Commit-Position: refs/heads/master@{#406798} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/ae25071e06a278c9b54bf850689422180f85a701 Cr-Commit-Position: refs/heads/master@{#406798} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
