New issue
Advanced search Search tips

Issue 791861 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Find Harmonized dialog's [X] close button for clicking via browsertests

Project Member Reported by jsaul@google.com, Dec 5 2017

Issue description

See 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?
 

Comment 1 by ma...@chromium.org, Dec 5 2017

Cc: tapted@chromium.org
From quick searching it's not obvious how other tests do it, apart from calling Close on the dialog perhaps to achieve the same result? 

https://cs.chromium.org/search/?q=Close+dialog+file:browsertest&sq=package:chromium&type=cs

I think you'd better ask Trent.

Comment 3 by jsaul@google.com, 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.
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.

Comment 5 by jsaul@google.com, 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!

Comment 6 by jsaul@google.com, Dec 20 2017

Status: Fixed (was: Assigned)
Thanks; this worked and is being resolved in https://chromium-review.googlesource.com/c/chromium/src/+/837155.  Closing bug.

Sign in to add a comment