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

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

Issue 1775933004: [merge-m49] CrOS: Don't paint tab-loading spinners in layers while in immersive fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 9 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 | chrome/browser/ui/views/tabs/tab.cc » ('j') | 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/frame/immersive_mode_controller_ash.h" 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // 3) Test that exiting tab fullscreen and immersive fullscreen 265 // 3) Test that exiting tab fullscreen and immersive fullscreen
266 // simultaneously correctly updates the shelf visibility and whether the tab 266 // simultaneously correctly updates the shelf visibility and whether the tab
267 // indicators should be hidden. 267 // indicators should be hidden.
268 SetTabFullscreen(true); 268 SetTabFullscreen(true);
269 ToggleFullscreen(); 269 ToggleFullscreen();
270 ASSERT_FALSE(controller()->IsEnabled()); 270 ASSERT_FALSE(controller()->IsEnabled());
271 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); 271 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state());
272 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); 272 EXPECT_TRUE(controller()->ShouldHideTabIndicators());
273 } 273 }
274 274
275 // Ensure the circular tab-loading throbbers are not painted as layers in
276 // immersive fullscreen, since the tab strip may animate in or out without
277 // moving the layers.
278 TEST_F(ImmersiveModeControllerAshTest, LayeredSpinners) {
279 AddTab(browser(), GURL("about:blank"));
280
281 TabStrip* tabstrip = browser_view()->tabstrip();
282
283 // Immersive fullscreen starts out disabled; layers are OK.
284 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen());
285 EXPECT_FALSE(controller()->IsEnabled());
286 EXPECT_TRUE(tabstrip->CanPaintThrobberToLayer());
287
288 ToggleFullscreen();
289 EXPECT_TRUE(browser_view()->GetWidget()->IsFullscreen());
290 EXPECT_TRUE(controller()->IsEnabled());
291 EXPECT_FALSE(tabstrip->CanPaintThrobberToLayer());
292
293 ToggleFullscreen();
294 EXPECT_TRUE(tabstrip->CanPaintThrobberToLayer());
295 }
296
275 class ImmersiveModeControllerAshTestHostedApp 297 class ImmersiveModeControllerAshTestHostedApp
276 : public ImmersiveModeControllerAshTest { 298 : public ImmersiveModeControllerAshTest {
277 public: 299 public:
278 ImmersiveModeControllerAshTestHostedApp() 300 ImmersiveModeControllerAshTestHostedApp()
279 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, 301 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP,
280 chrome::HOST_DESKTOP_TYPE_ASH, 302 chrome::HOST_DESKTOP_TYPE_ASH,
281 true) { 303 true) {
282 } 304 }
283 ~ImmersiveModeControllerAshTestHostedApp() override {} 305 ~ImmersiveModeControllerAshTestHostedApp() override {}
284 306
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 361
340 // Exit immersive fullscreen. The web contents should be back below the window 362 // Exit immersive fullscreen. The web contents should be back below the window
341 // header. 363 // header.
342 ToggleFullscreen(); 364 ToggleFullscreen();
343 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); 365 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen());
344 EXPECT_FALSE(controller()->IsEnabled()); 366 EXPECT_FALSE(controller()->IsEnabled());
345 EXPECT_FALSE(tabstrip->visible()); 367 EXPECT_FALSE(tabstrip->visible());
346 EXPECT_FALSE(toolbar->visible()); 368 EXPECT_FALSE(toolbar->visible());
347 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); 369 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y());
348 } 370 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698