Find Harmonized dialog's [X] close button for clicking via browsertests |
||
Issue descriptionSee TODO and comment: https://chromium-review.googlesource.com/c/chromium/src/+/786641/9/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc#219 and also: https://chromium-review.googlesource.com/c/chromium/src/+/786641/9/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc#132 There has to be a way to trigger the credit card upload bubble's [X] close button, but it's unclear what it is. It doesn't belong to the SaveCardBubbleViews, and clicking the most square element of its DialogClientView didn't seem to help, either. How are other browsertests handling this?
,
Dec 6 2017
I think you want BubbleFrameView::GetCloseButtonForTest()? http://cs.chromium.org/BubbleFrameView::GetCloseButtonForTest see e.g. https://cs.chromium.org/chromium/src/chrome/browser/ui/views/translate/translate_bubble_view_unittest.cc?sq=package:chromium&l=227
,
Dec 6 2017
I don't think we have one of those, unfortunately? https://cs.chromium.org/chromium/src/chrome/browser/ui/views/autofill/save_card_bubble_views.h?l=32&rcl=bf54b51cf5f2546ecfb7ad6a880ebf45fddc02aa SaveCardBubbleViews is a LocationBarBubbleDelegateView, which is a views::BubbleDialogDelegateView, which is a DialogDelegateView. I *can* get the test to work by calling LocationBarBubbleDelegateView::CloseBubble(). However, that function is protected so I'm not allowed to call it from Browsertests... https://cs.chromium.org/chromium/src/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h?l=81&rcl=22bf150b6fad408e508eb0efcb1bd7938f2b451b Could possibly override it in a different, friend-ed class and have that class call its super, but that seems like a less preferred approach.
,
Dec 6 2017
see the second link I posted - TranslateBubbleView is also a LocationBarBubbleDelegateView -- you just need to call GetBubbleFrameView on it. GetBubbleFrameView is protected, so you probably want to declare `SaveCardBubbleViewsFullFormBrowserTest` as a friend of SaveCardBubbleViews and add a static function to SaveCardBubbleViewsFullFormBrowserTest to close a bubble.
,
Dec 6 2017
Ah, it is, sorry! I tried looking for GetBubbleFrameView but it didn't show up because it was protected, yeah. I'll give this a shot, thanks!
,
Dec 20 2017
Thanks; this worked and is being resolved in https://chromium-review.googlesource.com/c/chromium/src/+/837155. Closing bug.
,
Jan 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fbf6271cc126aad96d8a67d2e8677bc272f28a1c commit fbf6271cc126aad96d8a67d2e8677bc272f28a1c Author: Jared Saul <jsaul@google.com> Date: Sat Jan 06 02:29:22 2018 Add browsertests for SendDetectedValues experiment Bug: 789645 , 791861 Change-Id: I3bfa66427a58dd52c466a9dc9658c1830ebfa5e7 Reviewed-on: https://chromium-review.googlesource.com/837155 Commit-Queue: Jared Saul <jsaul@google.com> Reviewed-by: Evan Stade <estade@chromium.org> Cr-Commit-Position: refs/heads/master@{#527477} [modify] https://crrev.com/fbf6271cc126aad96d8a67d2e8677bc272f28a1c/chrome/browser/ui/views/autofill/save_card_bubble_views.h [modify] https://crrev.com/fbf6271cc126aad96d8a67d2e8677bc272f28a1c/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc [modify] https://crrev.com/fbf6271cc126aad96d8a67d2e8677bc272f28a1c/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc [modify] https://crrev.com/fbf6271cc126aad96d8a67d2e8677bc272f28a1c/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h [modify] https://crrev.com/fbf6271cc126aad96d8a67d2e8677bc272f28a1c/components/test/data/autofill/credit_card_upload_form_address_and_cc.html |
||
►
Sign in to add a comment |
||
Comment 1 by ma...@chromium.org
, Dec 5 2017