Commit 5f30293d authored by spqchan's avatar spqchan Committed by Commit Bot

[MacViews] Fix PageInfoBubbleViewBrowserTest for polychrome

These tests click on the Views browser window's location bar
icon to display the Page Info Bubble. Unfortunately, that
does not exists on polychrome so this CL will just directly
show the page info bubble.

Bug: 817408
Change-Id: I40c526ef95021dd8b656277a9bc9f360567e8788
Reviewed-on: https://chromium-review.googlesource.com/959434
Commit-Queue: Sarah Chan <spqchan@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542944}
parent 654a0610
......@@ -11,6 +11,7 @@
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/page_info/page_info.h"
#include "chrome/browser/ui/page_info/page_info_dialog.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/view_ids.h"
......@@ -18,6 +19,7 @@
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
......@@ -54,6 +56,15 @@ void PerformMouseClickOnView(views::View* view) {
// Clicks the location icon to open the page info bubble.
void OpenPageInfoBubble(Browser* browser) {
#if BUILDFLAG(MAC_VIEWS_BROWSER)
if (views_mode_controller::IsViewsBrowserCocoa()) {
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
ShowPageInfoDialog(contents);
return;
}
#endif
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
LocationIconView* location_icon_view =
browser_view->toolbar()->location_bar()->location_icon_view();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment