Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc |
| diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc |
| index a442c392d4129805a4dd672088bd1c73c7706c84..889ecf0da867d366383b96d52efa44d9314f6fda 100644 |
| --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc |
| +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc |
| @@ -4,13 +4,16 @@ |
| #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| +#include "base/command_line.h" |
| #include "build/build_config.h" |
| #include "chrome/browser/ui/browser_commands.h" |
| #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
| +#include "chrome/browser/ui/test/test_browser_dialog.h" |
| #include "chrome/browser/ui/views/frame/browser_view.h" |
| #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| #include "chrome/test/base/in_process_browser_test.h" |
| +#include "ui/base/ui_base_switches.h" |
| typedef InProcessBrowserTest ZoomBubbleBrowserTest; |
| @@ -71,6 +74,34 @@ IN_PROC_BROWSER_TEST_F(ZoomBubbleBrowserTest, MAYBE_NonImmersiveFullscreen) { |
| } |
| } |
| +class ZoomBubbleDialogTest : public DialogBrowserTest { |
| + public: |
| + ZoomBubbleDialogTest() {} |
| + |
| + // DialogBrowserTest: |
| + void ShowDialog(const std::string& name) override { |
| + BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); |
| + content::WebContents* web_contents = browser_view->GetActiveWebContents(); |
| + ZoomBubbleView::ShowBubble(web_contents, gfx::Point(), |
| + ZoomBubbleView::USER_GESTURE); |
| + } |
| + |
| + // content::BrowserTestBase: |
| + void SetUpCommandLine(base::CommandLine* command_line) override { |
| + command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); |
|
Peter Kasting
2017/06/29 01:07:26
Why this line? Seems like you want to test the di
varkha
2017/06/29 01:14:36
Looked at a couple examples that are doing this so
|
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ZoomBubbleDialogTest); |
| +}; |
| + |
| +// Test that calls ShowDialog("default"). Interactive when run via |
| +// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| +// --dialog=ZoomBubbleDialogTest.InvokeDialog_default |
| +IN_PROC_BROWSER_TEST_F(ZoomBubbleDialogTest, InvokeDialog_default) { |
| + RunDialog(); |
| +} |
| + |
| // TODO(zturner): Change this to USE_ASH after fixing the test on Windows. |
| #if defined(OS_CHROMEOS) |
| // Test whether the zoom bubble is anchored and whether it is visible when in |