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

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

Issue 2653593004: chromeos: Remove AshTestBase::SupportsMultipleDisplays (Closed)
Patch Set: Created 3 years, 10 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/common/system/overview/overview_button_tray.h" 5 #include "ash/common/system/overview/overview_button_tray.h"
6 6
7 #include "ash/common/login_status.h" 7 #include "ash/common/login_status.h"
8 #include "ash/common/system/status_area_widget.h" 8 #include "ash/common/system/status_area_widget.h"
9 #include "ash/common/test/test_session_state_delegate.h" 9 #include "ash/common/test/test_session_state_delegate.h"
10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // user action. 134 // user action.
135 GetTray()->PerformAction(tap); 135 GetTray()->PerformAction(tap);
136 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); 136 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
137 EXPECT_EQ(3, user_action_tester.GetActionCount(kTrayOverview)); 137 EXPECT_EQ(3, user_action_tester.GetActionCount(kTrayOverview));
138 } 138 }
139 139
140 // Tests that a second OverviewButtonTray has been created, and only shows 140 // Tests that a second OverviewButtonTray has been created, and only shows
141 // when MaximizeMode has been enabled, when we are using multiple displays. 141 // when MaximizeMode has been enabled, when we are using multiple displays.
142 // By default the DisplayManger is in extended mode. 142 // By default the DisplayManger is in extended mode.
143 TEST_F(OverviewButtonTrayTest, DisplaysOnBothDisplays) { 143 TEST_F(OverviewButtonTrayTest, DisplaysOnBothDisplays) {
144 if (!SupportsMultipleDisplays())
145 return;
146
147 UpdateDisplay("400x400,200x200"); 144 UpdateDisplay("400x400,200x200");
148 EXPECT_FALSE(GetTray()->visible()); 145 EXPECT_FALSE(GetTray()->visible());
149 EXPECT_FALSE(GetSecondaryTray()->visible()); 146 EXPECT_FALSE(GetSecondaryTray()->visible());
150 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 147 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
151 true); 148 true);
152 EXPECT_TRUE(GetTray()->visible()); 149 EXPECT_TRUE(GetTray()->visible());
153 EXPECT_TRUE(GetSecondaryTray()->visible()); 150 EXPECT_TRUE(GetSecondaryTray()->visible());
154 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 151 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
155 false); 152 false);
156 } 153 }
157 154
158 // Tests if Maximize Mode is enabled before a secondary display is attached 155 // Tests if Maximize Mode is enabled before a secondary display is attached
159 // that the second OverviewButtonTray should be created in a visible state. 156 // that the second OverviewButtonTray should be created in a visible state.
160 TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) { 157 TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) {
161 if (!SupportsMultipleDisplays())
162 return;
163
164 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 158 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
165 true); 159 true);
166 UpdateDisplay("400x400,200x200"); 160 UpdateDisplay("400x400,200x200");
167 EXPECT_TRUE(GetSecondaryTray()->visible()); 161 EXPECT_TRUE(GetSecondaryTray()->visible());
168 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 162 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
169 false); 163 false);
170 } 164 }
171 165
172 // Tests that the tray loses visibility when a user logs out, and that it 166 // Tests that the tray loses visibility when a user logs out, and that it
173 // regains visibility when a user logs back in. 167 // regains visibility when a user logs back in.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); 245 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen());
252 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 246 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
253 true); 247 true);
254 EXPECT_TRUE(GetTray()->visible()); 248 EXPECT_TRUE(GetTray()->visible());
255 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 249 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
256 false); 250 false);
257 EXPECT_FALSE(GetTray()->visible()); 251 EXPECT_FALSE(GetTray()->visible());
258 } 252 }
259 253
260 } // namespace ash 254 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc ('k') | ash/system/toast/toast_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698