Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Issue 2860453004: Fix PasswordsSettingsTestCase.testCopyPasswordToast (Closed)

Created:
3 years, 7 months ago by vabr (Chromium)
Modified:
3 years, 7 months ago
Reviewers:
baxley, lpromero
CC:
chromium-reviews, marq+watch_chromium.org, ios-reviews+chrome_chromium.org, noyau+watch_chromium.org, ios-reviews_chromium.org, pkl (ping after 24h if needed)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix PasswordsSettingsTestCase.testCopyPasswordToast The tested settings have a button just at the bottom end of the screen on small devices. Tapping the button results in showing a snackbar, which covers the button on small devices. testCopyPasswordToast in particular needs to tap the copy button twice. The second tap was impossible on small devices because the snackbar was still around, blocking the button. This CL adds two actions to prevent this issue: (1) While checking for the snackbar, the test also taps it, causing it to close. The test waits for the fade-out animation to finish. (2) The test also uses usingSearchAction:grey_scrollInDirection to ask EarlGrey to scroll until the control is clickable. Even though either single option from the above would fix the current issue, the CL contains both: (2) because it will also be useful on smaller devices, e.g., should we start testing in landscape mode (see https://crbug.com/717548 and also https://crbug.com/717163 for another blocker for landscape mode), where the buttons will be off the screen instead of just being covered. It also includes (1), because cleaning up the snackbar explicitly seems like a reasonable thing to do. Speaking of cleaning up, the CL also: (3) Forcibly closes all passwords-related snackbars on teardown. This will be useful when the test fails in the middle, leaving a snackbar up. If not foce-closed, such snackbar would remain visible for (currently) 4 seconds, which might be enough to interfere with the next test. The CL also applied (1) and (2) to two other tests in the same suite as well. Those deal with similar buttons, which are currently high enough not to experience the problem with being blocked. This secures them in case that, e.g., the layout changes in the future. Note that while (2) is clearly beneficial, it also has a drawback: the search action takes a considerable amount of time (about 2 seconds per one scrolling step on my computer). With it, the tests are more likely to time out. If there is an issue with timing out in the future, we should increase kScrollAmount to speed up the scrolling, or split long tests (testCopyPasswordToast is a particular candidate). BUG=718043 Review-Url: https://codereview.chromium.org/2860453004 Cr-Commit-Position: refs/heads/master@{#469361} Committed: https://chromium.googlesource.com/chromium/src/+/6d0700c264fabe9d1b6857b2f860759544c4e640

Patch Set 1 : No fix, just enabled in hope to find a trybot with iPhone 5 #

Patch Set 2 : Fix PasswordsSettingsTestCase.testCopyPasswordToast #

Total comments: 2

Patch Set 3 : Always close the snackbars #

Total comments: 3

Patch Set 4 : Hide snackbars on teardown #

Patch Set 5 : Add scrolling #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -10 lines) Patch
M ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M ios/chrome/browser/ui/settings/passwords_settings_egtest.mm View 1 2 3 4 10 chunks +55 lines, -10 lines 2 comments Download

Messages

Total messages: 30 (12 generated)
vabr (Chromium)
Hi baxley@, Please check whether my fix makes sense to you. In particular, let me ...
3 years, 7 months ago (2017-05-03 17:46:47 UTC) #5
baxley
I agree with your approach, thanks for the good description/comment. I just have one question ...
3 years, 7 months ago (2017-05-03 18:07:11 UTC) #9
vabr (Chromium)
Thanks for the review. Please see my response below. Cheers, Vaclav https://codereview.chromium.org/2860453004/diff/20001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm File ios/chrome/browser/ui/settings/passwords_settings_egtest.mm (right): ...
3 years, 7 months ago (2017-05-03 20:32:26 UTC) #10
baxley
On 2017/05/03 20:32:26, vabr (hobby only until 5 June) wrote: > Thanks for the review. ...
3 years, 7 months ago (2017-05-03 20:49:28 UTC) #11
vabr (Chromium)
One more update: I realised that keeping the snackbars open after the end of the ...
3 years, 7 months ago (2017-05-03 20:51:03 UTC) #12
vabr (Chromium)
Thanks for the review, baxley@! We appeared to have posted our latest updates at the ...
3 years, 7 months ago (2017-05-03 20:54:21 UTC) #14
baxley
On 2017/05/03 20:54:21, vabr (hobby only until 5 June) wrote: > Thanks for the review, ...
3 years, 7 months ago (2017-05-03 21:10:58 UTC) #15
lpromero
lgtm https://codereview.chromium.org/2860453004/diff/40001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm File ios/chrome/browser/ui/settings/passwords_settings_egtest.mm (right): https://codereview.chromium.org/2860453004/diff/40001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm#newcode378 ios/chrome/browser/ui/settings/passwords_settings_egtest.mm:378: // button won't work when the snackbar is ...
3 years, 7 months ago (2017-05-04 09:21:08 UTC) #16
vabr (Chromium)
Thanks both for the review! lpromero@ -- I don't have a good answer yet (see ...
3 years, 7 months ago (2017-05-04 11:00:04 UTC) #17
lpromero
https://codereview.chromium.org/2860453004/diff/40001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm File ios/chrome/browser/ui/settings/passwords_settings_egtest.mm (right): https://codereview.chromium.org/2860453004/diff/40001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm#newcode378 ios/chrome/browser/ui/settings/passwords_settings_egtest.mm:378: // button won't work when the snackbar is up. ...
3 years, 7 months ago (2017-05-04 11:24:54 UTC) #18
vabr (Chromium)
Thanks again, both of you, for asking the right questions! I added the teardown for ...
3 years, 7 months ago (2017-05-04 14:46:52 UTC) #20
lpromero
Latest patch LGTM. Thanks for going to the bottom of it! https://codereview.chromium.org/2860453004/diff/70001/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm File ios/chrome/browser/ui/settings/passwords_settings_egtest.mm (right): ...
3 years, 7 months ago (2017-05-04 15:55:41 UTC) #21
baxley
On 2017/05/04 14:46:52, vabr (hobby-only until 5 June) wrote: > Thanks again, both of you, ...
3 years, 7 months ago (2017-05-04 16:25:28 UTC) #22
vabr (Chromium)
Thanks for the swift replies, both of you! I'm landing now and will check on ...
3 years, 7 months ago (2017-05-04 16:38:20 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860453004/70001
3 years, 7 months ago (2017-05-04 16:38:58 UTC) #25
baxley
On 2017/05/04 16:38:20, vabr (hobby-only until 5 June) wrote: > Thanks for the swift replies, ...
3 years, 7 months ago (2017-05-04 16:44:21 UTC) #26
commit-bot: I haz the power
Committed patchset #5 (id:70001) as https://chromium.googlesource.com/chromium/src/+/6d0700c264fabe9d1b6857b2f860759544c4e640
3 years, 7 months ago (2017-05-04 16:54:27 UTC) #29
vabr (Chromium)
3 years, 7 months ago (2017-05-04 17:26:05 UTC) #30
Message was sent while issue was closed.
On 2017/05/04 16:44:21, baxley wrote:
> On 2017/05/04 16:38:20, vabr (hobby-only until 5 June) wrote:
> > Thanks for the swift replies, both of you!
> > 
> > I'm landing now and will check on the bots later tonight.
> You're in luck, I'm iOS sheriff the next few days and know what to look for,
so
> don't worry about checking in outside of work hours.

That's great, thanks a lot!
Vaclav

Powered by Google App Engine
This is Rietveld 408576698