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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc

Issue 16070003: Move immersive fullscreen check into ImmersiveFullscreenConfiguration. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync+rebase Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/autocomplete/autocomplete_controller.h" 8 #include "chrome/browser/autocomplete/autocomplete_controller.h"
9 #include "chrome/browser/search/search.h" 9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
11 #include "chrome/browser/ui/immersive_fullscreen_configuration.h"
11 #include "chrome/browser/ui/omnibox/omnibox_view.h" 12 #include "chrome/browser/ui/omnibox/omnibox_view.h"
12 #include "chrome/browser/ui/search/instant_test_utils.h" 13 #include "chrome/browser/ui/search/instant_test_utils.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 15 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
15 #include "chrome/browser/ui/views/frame/contents_container.h" 16 #include "chrome/browser/ui/views/frame/contents_container.h"
16 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 17 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
17 #include "chrome/browser/ui/views/frame/overlay_container.h" 18 #include "chrome/browser/ui/views/frame/overlay_container.h"
18 #include "chrome/browser/ui/views/frame/top_container_view.h" 19 #include "chrome/browser/ui/views/frame/top_container_view.h"
19 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 20 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
20 #include "chrome/browser/ui/views/tabs/tab.h" 21 #include "chrome/browser/ui/views/tabs/tab.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Immersive fullscreen is currently enabled only on Chrome OS. 166 // Immersive fullscreen is currently enabled only on Chrome OS.
166 #if defined(OS_CHROMEOS) 167 #if defined(OS_CHROMEOS)
167 168
168 class BrowserViewImmersiveInstantExtendedTest : public InProcessBrowserTest, 169 class BrowserViewImmersiveInstantExtendedTest : public InProcessBrowserTest,
169 public InstantTestBase { 170 public InstantTestBase {
170 public: 171 public:
171 BrowserViewImmersiveInstantExtendedTest() {} 172 BrowserViewImmersiveInstantExtendedTest() {}
172 virtual ~BrowserViewImmersiveInstantExtendedTest() {} 173 virtual ~BrowserViewImmersiveInstantExtendedTest() {}
173 174
174 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 175 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
175 chrome::EnableImmersiveFullscreenForTest(); 176 ImmersiveFullscreenConfiguration::EnableImmersiveFullscreenForTest();
176 chrome::EnableInstantExtendedAPIForTesting(); 177 chrome::EnableInstantExtendedAPIForTesting();
177 ASSERT_TRUE(https_test_server().Start()); 178 ASSERT_TRUE(https_test_server().Start());
178 GURL instant_url = https_test_server().GetURL( 179 GURL instant_url = https_test_server().GetURL(
179 "files/instant_extended.html?strk=1&"); 180 "files/instant_extended.html?strk=1&");
180 InstantTestBase::Init(instant_url); 181 InstantTestBase::Init(instant_url);
181 } 182 }
182 183
183 private: 184 private:
184 DISALLOW_COPY_AND_ASSIGN(BrowserViewImmersiveInstantExtendedTest); 185 DISALLOW_COPY_AND_ASSIGN(BrowserViewImmersiveInstantExtendedTest);
185 }; 186 };
186 187
187 IN_PROC_BROWSER_TEST_F(BrowserViewImmersiveInstantExtendedTest, 188 IN_PROC_BROWSER_TEST_F(BrowserViewImmersiveInstantExtendedTest,
188 ImmersiveInstantExtended) { 189 ImmersiveInstantExtended) {
189 ui::ScopedAnimationDurationScaleMode zero_duration_mode( 190 ui::ScopedAnimationDurationScaleMode zero_duration_mode(
190 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); 191 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION);
191 BookmarkBarView::DisableAnimationsForTesting(true); 192 BookmarkBarView::DisableAnimationsForTesting(true);
192 193
193 // Cache some pointers we'll need below. 194 // Cache some pointers we'll need below.
194 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); 195 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
195 ToolbarView* toolbar = browser_view->toolbar(); 196 ToolbarView* toolbar = browser_view->toolbar();
196 197
197 // Start up both instant and immersive fullscreen. 198 // Start up both instant and immersive fullscreen.
198 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); 199 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
199 ASSERT_TRUE(chrome::UseImmersiveFullscreen()); 200 ASSERT_TRUE(ImmersiveFullscreenConfiguration::UseImmersiveFullscreen());
200 chrome::ToggleFullscreenMode(browser()); 201 chrome::ToggleFullscreenMode(browser());
201 ASSERT_TRUE(browser_view->IsFullscreen()); 202 ASSERT_TRUE(browser_view->IsFullscreen());
202 ASSERT_TRUE(browser_view->immersive_mode_controller()->IsEnabled()); 203 ASSERT_TRUE(browser_view->immersive_mode_controller()->IsEnabled());
203 204
204 //////////////////////////////////////////////////////////////////////////// 205 ////////////////////////////////////////////////////////////////////////////
205 // Test suggestions on a normal web page, which are in an overlay. 206 // Test suggestions on a normal web page, which are in an overlay.
206 207
207 // Focus omnibox, which constructs an overlay web contents. 208 // Focus omnibox, which constructs an overlay web contents.
208 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); 209 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
209 EXPECT_TRUE(instant()->model()->mode().is_default()); 210 EXPECT_TRUE(instant()->model()->mode().is_default());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 EXPECT_TRUE(browser_view->immersive_mode_controller()->IsRevealed()); 289 EXPECT_TRUE(browser_view->immersive_mode_controller()->IsRevealed());
289 // The active web contents are aligned with the toolbar. 290 // The active web contents are aligned with the toolbar.
290 gfx::Rect web_view_rect_in_widget = GetRectInWidget( 291 gfx::Rect web_view_rect_in_widget = GetRectInWidget(
291 browser_view->GetContentsContainerForTest()->GetActiveWebViewForTest()); 292 browser_view->GetContentsContainerForTest()->GetActiveWebViewForTest());
292 EXPECT_EQ(GetRectInWidget(toolbar).bottom(), web_view_rect_in_widget.y()); 293 EXPECT_EQ(GetRectInWidget(toolbar).bottom(), web_view_rect_in_widget.y());
293 294
294 BookmarkBarView::DisableAnimationsForTesting(false); 295 BookmarkBarView::DisableAnimationsForTesting(false);
295 } 296 }
296 297
297 #endif // defined(OS_CHROMEOS) 298 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/frame/immersive_mode_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698