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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 25551002: Fix visibility of minimized panels when restoring from overview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Alternate workaround. Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/overview/scoped_transform_overview_window.cc ('k') | 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 "ash/launcher/launcher.h" 5 #include "ash/launcher/launcher.h"
6 #include "ash/root_window_controller.h" 6 #include "ash/root_window_controller.h"
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shelf/shelf_widget.h" 8 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 wm::WindowState* window_state = wm::GetWindowState(window1.get()); 192 wm::WindowState* window_state = wm::GetWindowState(window1.get());
193 window_state->Maximize(); 193 window_state->Maximize();
194 ash::ShelfWidget* shelf = Shell::GetPrimaryRootWindowController()->shelf(); 194 ash::ShelfWidget* shelf = Shell::GetPrimaryRootWindowController()->shelf();
195 EXPECT_TRUE(shelf->GetDimsShelf()); 195 EXPECT_TRUE(shelf->GetDimsShelf());
196 ToggleOverview(); 196 ToggleOverview();
197 EXPECT_FALSE(shelf->GetDimsShelf()); 197 EXPECT_FALSE(shelf->GetDimsShelf());
198 ToggleOverview(); 198 ToggleOverview();
199 EXPECT_TRUE(shelf->GetDimsShelf()); 199 EXPECT_TRUE(shelf->GetDimsShelf());
200 } 200 }
201 201
202 // Tests that a minimized window's visibility and layer visibility is correctly
203 // changed when entering overview and restored when leaving overview mode.
204 TEST_F(WindowSelectorTest, MinimizedWindowVisibility) {
205 gfx::Rect bounds(0, 0, 400, 400);
206 scoped_ptr<aura::Window> window1(CreateWindow(bounds));
207 wm::WindowState* window_state = wm::GetWindowState(window1.get());
208 window_state->Minimize();
209 EXPECT_FALSE(window1->IsVisible());
210 EXPECT_FALSE(window1->layer()->GetTargetVisibility());
211 {
212 ui::ScopedAnimationDurationScaleMode normal_duration_mode(
213 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
214 ToggleOverview();
215 EXPECT_TRUE(window1->IsVisible());
216 EXPECT_TRUE(window1->layer()->GetTargetVisibility());
217 }
218 {
219 ui::ScopedAnimationDurationScaleMode normal_duration_mode(
220 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
221 ToggleOverview();
222 EXPECT_FALSE(window1->IsVisible());
223 EXPECT_FALSE(window1->layer()->GetTargetVisibility());
224 }
225 }
226
202 // Tests entering overview mode with three windows and cycling through them. 227 // Tests entering overview mode with three windows and cycling through them.
203 TEST_F(WindowSelectorTest, BasicCycle) { 228 TEST_F(WindowSelectorTest, BasicCycle) {
204 gfx::Rect bounds(0, 0, 400, 400); 229 gfx::Rect bounds(0, 0, 400, 400);
205 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); 230 scoped_ptr<aura::Window> window1(CreateWindow(bounds));
206 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); 231 scoped_ptr<aura::Window> window2(CreateWindow(bounds));
207 scoped_ptr<aura::Window> window3(CreateWindow(bounds)); 232 scoped_ptr<aura::Window> window3(CreateWindow(bounds));
208 wm::ActivateWindow(window3.get()); 233 wm::ActivateWindow(window3.get());
209 wm::ActivateWindow(window2.get()); 234 wm::ActivateWindow(window2.get());
210 wm::ActivateWindow(window1.get()); 235 wm::ActivateWindow(window1.get());
211 EXPECT_TRUE(wm::IsActiveWindow(window1.get())); 236 EXPECT_TRUE(wm::IsActiveWindow(window1.get()));
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 Cycle(WindowSelector::FORWARD); 556 Cycle(WindowSelector::FORWARD);
532 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( 557 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains(
533 ToEnclosingRect(GetTransformedTargetBounds(window1.get())))); 558 ToEnclosingRect(GetTransformedTargetBounds(window1.get()))));
534 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( 559 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains(
535 ToEnclosingRect(GetTransformedTargetBounds(window2.get())))); 560 ToEnclosingRect(GetTransformedTargetBounds(window2.get()))));
536 StopCycling(); 561 StopCycling();
537 } 562 }
538 563
539 } // namespace internal 564 } // namespace internal
540 } // namespace ash 565 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/scoped_transform_overview_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698