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

Side by Side Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc

Issue 2963893002: [ui] Adds a browser_tests hook to show ZoomBubbleView (Closed)
Patch Set: [ui] Adds a browser_tests hook to show ZoomBubbleView (no command line) Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" 5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/ui/browser_commands.h" 8 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h"
11 #include "chrome/browser/ui/test/test_browser_dialog.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 13 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
13 #include "chrome/test/base/in_process_browser_test.h" 14 #include "chrome/test/base/in_process_browser_test.h"
14 15
15 typedef InProcessBrowserTest ZoomBubbleBrowserTest; 16 typedef InProcessBrowserTest ZoomBubbleBrowserTest;
16 17
17 #if defined(USE_ASH) 18 #if defined(USE_ASH)
18 #include "ash/test/immersive_fullscreen_controller_test_api.h" 19 #include "ash/test/immersive_fullscreen_controller_test_api.h"
19 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" 20 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
20 #endif 21 #endif
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 // Exit fullscreen before ending the test for the sake of sanity. 134 // Exit fullscreen before ending the test for the sake of sanity.
134 { 135 {
135 std::unique_ptr<FullscreenNotificationObserver> waiter( 136 std::unique_ptr<FullscreenNotificationObserver> waiter(
136 new FullscreenNotificationObserver()); 137 new FullscreenNotificationObserver());
137 chrome::ToggleFullscreenMode(browser()); 138 chrome::ToggleFullscreenMode(browser());
138 waiter->Wait(); 139 waiter->Wait();
139 } 140 }
140 } 141 }
141 #endif // OS_CHROMEOS 142 #endif // OS_CHROMEOS
143
144 class ZoomBubbleDialogTest : public DialogBrowserTest {
145 public:
146 ZoomBubbleDialogTest() {}
147
148 // DialogBrowserTest:
149 void ShowDialog(const std::string& name) override {
150 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
151 content::WebContents* web_contents = browser_view->GetActiveWebContents();
152 ZoomBubbleView::ShowBubble(web_contents, gfx::Point(),
153 ZoomBubbleView::USER_GESTURE);
154 }
155
156 private:
157 DISALLOW_COPY_AND_ASSIGN(ZoomBubbleDialogTest);
158 };
159
160 // Test that calls ShowDialog("default"). Interactive when run via
161 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive
162 // --dialog=ZoomBubbleDialogTest.InvokeDialog_default
163 IN_PROC_BROWSER_TEST_F(ZoomBubbleDialogTest, InvokeDialog_default) {
164 RunDialog();
165 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698