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

Side by Side Diff: ash/system/overview/overview_button_tray_unittest.cc

Issue 1114383002: Show overview mode button in TouchView with open modal window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/overview/overview_button_tray.h" 5 #include "ash/system/overview/overview_button_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/rotator/screen_rotation_animator.h" 10 #include "ash/rotator/screen_rotation_animator.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_NONE); 140 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_NONE);
141 EXPECT_FALSE(GetTray()->visible()); 141 EXPECT_FALSE(GetTray()->visible());
142 SetUserLoggedIn(true); 142 SetUserLoggedIn(true);
143 SetSessionStarted(true); 143 SetSessionStarted(true);
144 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER); 144 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER);
145 EXPECT_TRUE(GetTray()->visible()); 145 EXPECT_TRUE(GetTray()->visible());
146 Shell::GetInstance()->maximize_mode_controller()-> 146 Shell::GetInstance()->maximize_mode_controller()->
147 EnableMaximizeModeWindowManager(false); 147 EnableMaximizeModeWindowManager(false);
148 } 148 }
149 149
150 // Tests that the overview button becomes visible when the user enters
151 // maximize mode with a system modal window open, and that it hides once
152 // the user exits maximize mode.
153 TEST_F(OverviewButtonTrayTest, VisibilityChangesForSystemModalWindow) {
154 scoped_ptr<aura::Window> window(
155 CreateTestModalWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
156 ASSERT_TRUE(Shell::GetInstance()->IsSystemModalWindowOpen());
157 Shell::GetInstance()
158 ->maximize_mode_controller()
159 ->EnableMaximizeModeWindowManager(true);
160 EXPECT_TRUE(GetTray()->visible());
161 Shell::GetInstance()
162 ->maximize_mode_controller()
163 ->EnableMaximizeModeWindowManager(false);
164 EXPECT_FALSE(GetTray()->visible());
165 }
166
150 // Tests that the tray only renders as active while selection is ongoing. Any 167 // Tests that the tray only renders as active while selection is ongoing. Any
151 // dismissal of overview mode clears the active state. 168 // dismissal of overview mode clears the active state.
152 TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) { 169 TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) {
153 ASSERT_FALSE( 170 ASSERT_FALSE(
154 Shell::GetInstance()->window_selector_controller()->IsSelecting()); 171 Shell::GetInstance()->window_selector_controller()->IsSelecting());
155 ASSERT_FALSE(GetTray()->draw_background_as_active()); 172 ASSERT_FALSE(GetTray()->draw_background_as_active());
156 173
157 // Overview Mode only works when there is a window 174 // Overview Mode only works when there is a window
158 scoped_ptr<aura::Window> window( 175 scoped_ptr<aura::Window> window(
159 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); 176 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
(...skipping 29 matching lines...) Expand all
189 new ui::ScopedAnimationDurationScaleMode( 206 new ui::ScopedAnimationDurationScaleMode(
190 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); 207 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
191 ash::ScreenRotationAnimator(gfx::Display::InternalDisplayId()) 208 ash::ScreenRotationAnimator(gfx::Display::InternalDisplayId())
192 .Rotate(gfx::Display::ROTATE_270, gfx::Display::ROTATION_SOURCE_ACTIVE); 209 .Rotate(gfx::Display::ROTATE_270, gfx::Display::ROTATION_SOURCE_ACTIVE);
193 210
194 RunAllPendingInMessageLoop(); 211 RunAllPendingInMessageLoop();
195 EXPECT_FALSE(GetTray()->visible()); 212 EXPECT_FALSE(GetTray()->visible());
196 } 213 }
197 214
198 } // namespace ash 215 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698