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

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

Issue 1779693002: [merge] CrOS: Don't paint tab-loading spinners in layers while in immersive fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // 3) Test that exiting tab fullscreen and immersive fullscreen 256 // 3) Test that exiting tab fullscreen and immersive fullscreen
257 // simultaneously correctly updates the shelf visibility and whether the tab 257 // simultaneously correctly updates the shelf visibility and whether the tab
258 // indicators should be hidden. 258 // indicators should be hidden.
259 SetTabFullscreen(true); 259 SetTabFullscreen(true);
260 ToggleFullscreen(); 260 ToggleFullscreen();
261 ASSERT_FALSE(controller()->IsEnabled()); 261 ASSERT_FALSE(controller()->IsEnabled());
262 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); 262 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state());
263 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); 263 EXPECT_TRUE(controller()->ShouldHideTabIndicators());
264 } 264 }
265 265
266 // Ensure the circular tab-loading throbbers are not painted as layers in
267 // immersive fullscreen, since the tab strip may animate in or out without
268 // moving the layers.
269 TEST_F(ImmersiveModeControllerAshTest, LayeredSpinners) {
270 AddTab(browser(), GURL("about:blank"));
271
272 TabStrip* tabstrip = browser_view()->tabstrip();
273
274 // Immersive fullscreen starts out disabled; layers are OK.
275 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen());
276 EXPECT_FALSE(controller()->IsEnabled());
277 EXPECT_TRUE(tabstrip->CanPaintThrobberToLayer());
278
279 ToggleFullscreen();
280 EXPECT_TRUE(browser_view()->GetWidget()->IsFullscreen());
281 EXPECT_TRUE(controller()->IsEnabled());
282 EXPECT_FALSE(tabstrip->CanPaintThrobberToLayer());
283
284 ToggleFullscreen();
285 EXPECT_TRUE(tabstrip->CanPaintThrobberToLayer());
286 }
287
266 class ImmersiveModeControllerAshTestHostedApp 288 class ImmersiveModeControllerAshTestHostedApp
267 : public ImmersiveModeControllerAshTest { 289 : public ImmersiveModeControllerAshTest {
268 public: 290 public:
269 ImmersiveModeControllerAshTestHostedApp() 291 ImmersiveModeControllerAshTestHostedApp()
270 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, true) {} 292 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, true) {}
271 ~ImmersiveModeControllerAshTestHostedApp() override {} 293 ~ImmersiveModeControllerAshTestHostedApp() override {}
272 294
273 private: 295 private:
274 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAshTestHostedApp); 296 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAshTestHostedApp);
275 }; 297 };
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 349
328 // Exit immersive fullscreen. The web contents should be back below the window 350 // Exit immersive fullscreen. The web contents should be back below the window
329 // header. 351 // header.
330 ToggleFullscreen(); 352 ToggleFullscreen();
331 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); 353 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen());
332 EXPECT_FALSE(controller()->IsEnabled()); 354 EXPECT_FALSE(controller()->IsEnabled());
333 EXPECT_FALSE(tabstrip->visible()); 355 EXPECT_FALSE(tabstrip->visible());
334 EXPECT_FALSE(toolbar->visible()); 356 EXPECT_FALSE(toolbar->visible());
335 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); 357 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y());
336 } 358 }
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