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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc

Issue 2899253002: chromeos: Rename ash::WmShelf to Shelf (Closed)
Patch Set: rebase Created 3 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 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "ash/content/shell_content_state.h" 7 #include "ash/content/shell_content_state.h"
8 #include "ash/public/cpp/shell_window_ids.h" 8 #include "ash/public/cpp/shell_window_ids.h"
9 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shelf/wm_shelf.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
13 #include "ash/test/ash_test_environment_content.h" 13 #include "ash/test/ash_test_environment_content.h"
14 #include "ash/test/ash_test_helper.h" 14 #include "ash/test/ash_test_helper.h"
15 #include "ash/test/test_shell_delegate.h" 15 #include "ash/test/test_shell_delegate.h"
16 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 16 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
17 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" 17 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
18 #include "ash/wm/mru_window_tracker.h" 18 #include "ash/wm/mru_window_tracker.h"
19 #include "ash/wm/window_state.h" 19 #include "ash/wm/window_state.h"
20 #include "ash/wm/window_util.h" 20 #include "ash/wm/window_util.h"
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 multi_user_window_manager()->SetAnimationSpeedForTest( 1031 multi_user_window_manager()->SetAnimationSpeedForTest(
1032 chrome::MultiUserWindowManagerChromeOS::ANIMATION_SPEED_FAST); 1032 chrome::MultiUserWindowManagerChromeOS::ANIMATION_SPEED_FAST);
1033 // Set some owners and make sure we got what we asked for. 1033 // Set some owners and make sure we got what we asked for.
1034 multi_user_window_manager()->SetWindowOwner(window(0), account_id_A); 1034 multi_user_window_manager()->SetWindowOwner(window(0), account_id_A);
1035 multi_user_window_manager()->SetWindowOwner(window(1), account_id_B); 1035 multi_user_window_manager()->SetWindowOwner(window(1), account_id_B);
1036 multi_user_window_manager()->SetWindowOwner(window(2), account_id_C); 1036 multi_user_window_manager()->SetWindowOwner(window(2), account_id_C);
1037 EXPECT_FALSE(CoversScreen(window(0))); 1037 EXPECT_FALSE(CoversScreen(window(0)));
1038 EXPECT_FALSE(CoversScreen(window(1))); 1038 EXPECT_FALSE(CoversScreen(window(1)));
1039 EXPECT_EQ("S[A], H[B], H[C]", GetStatus()); 1039 EXPECT_EQ("S[A], H[B], H[C]", GetStatus());
1040 EXPECT_EQ("A", GetOwnersOfVisibleWindowsAsString()); 1040 EXPECT_EQ("A", GetOwnersOfVisibleWindowsAsString());
1041 WmShelf* shelf = GetPrimaryShelf(); 1041 Shelf* shelf = GetPrimaryShelf();
1042 EXPECT_NE(SHELF_AUTO_HIDE_ALWAYS_HIDDEN, shelf->auto_hide_behavior()); 1042 EXPECT_NE(SHELF_AUTO_HIDE_ALWAYS_HIDDEN, shelf->auto_hide_behavior());
1043 EXPECT_EQ(1.0f, window(0)->layer()->GetTargetOpacity()); 1043 EXPECT_EQ(1.0f, window(0)->layer()->GetTargetOpacity());
1044 ShelfWidget* shelf_widget = shelf->shelf_widget(); 1044 ShelfWidget* shelf_widget = shelf->shelf_widget();
1045 EXPECT_FALSE(shelf_widget->IsShelfHiddenBehindBlackBar()); 1045 EXPECT_FALSE(shelf_widget->IsShelfHiddenBehindBlackBar());
1046 1046
1047 // Start the animation and see that the old window is becoming invisible, the 1047 // Start the animation and see that the old window is becoming invisible, the
1048 // new one is becoming visible, the background starts transitionining and the 1048 // new one is becoming visible, the background starts transitionining and the
1049 // shelf hides. 1049 // shelf hides.
1050 StartUserTransitionAnimation(account_id_B); 1050 StartUserTransitionAnimation(account_id_B);
1051 EXPECT_EQ(kArrowBAccountIdString, 1051 EXPECT_EQ(kArrowBAccountIdString,
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 // Test that switching between users with the shelf in the same place, the shelf 1314 // Test that switching between users with the shelf in the same place, the shelf
1315 // will get covered with a black bar instead being hidden and re-shown. 1315 // will get covered with a black bar instead being hidden and re-shown.
1316 TEST_F(MultiUserWindowManagerChromeOSTest, TestBlackBarCover) { 1316 TEST_F(MultiUserWindowManagerChromeOSTest, TestBlackBarCover) {
1317 SetUpForThisManyWindows(2); 1317 SetUpForThisManyWindows(2);
1318 1318
1319 const AccountId account_id_A(AccountId::FromUserEmail("A")); 1319 const AccountId account_id_A(AccountId::FromUserEmail("A"));
1320 const AccountId account_id_B(AccountId::FromUserEmail("B")); 1320 const AccountId account_id_B(AccountId::FromUserEmail("B"));
1321 1321
1322 multi_user_window_manager()->SetWindowOwner(window(0), account_id_A); 1322 multi_user_window_manager()->SetWindowOwner(window(0), account_id_A);
1323 multi_user_window_manager()->SetWindowOwner(window(1), account_id_B); 1323 multi_user_window_manager()->SetWindowOwner(window(1), account_id_B);
1324 WmShelf* shelf = GetPrimaryShelf(); 1324 Shelf* shelf = GetPrimaryShelf();
1325 1325
1326 // Turn the use of delays and animation on. 1326 // Turn the use of delays and animation on.
1327 multi_user_window_manager()->SetAnimationSpeedForTest( 1327 multi_user_window_manager()->SetAnimationSpeedForTest(
1328 chrome::MultiUserWindowManagerChromeOS::ANIMATION_SPEED_FAST); 1328 chrome::MultiUserWindowManagerChromeOS::ANIMATION_SPEED_FAST);
1329 EXPECT_NE(SHELF_AUTO_HIDE_ALWAYS_HIDDEN, shelf->auto_hide_behavior()); 1329 EXPECT_NE(SHELF_AUTO_HIDE_ALWAYS_HIDDEN, shelf->auto_hide_behavior());
1330 ShelfWidget* shelf_widget = shelf->shelf_widget(); 1330 ShelfWidget* shelf_widget = shelf->shelf_widget();
1331 EXPECT_FALSE(shelf_widget->IsShelfHiddenBehindBlackBar()); 1331 EXPECT_FALSE(shelf_widget->IsShelfHiddenBehindBlackBar());
1332 1332
1333 // First test that with no maximized window we show/hide the shelf. 1333 // First test that with no maximized window we show/hide the shelf.
1334 StartUserTransitionAnimation(account_id_B); 1334 StartUserTransitionAnimation(account_id_B);
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 user_manager()->SwitchActiveUser(account_id_B); 1578 user_manager()->SwitchActiveUser(account_id_B);
1579 multi_user_window_manager()->ActiveUserChanged( 1579 multi_user_window_manager()->ActiveUserChanged(
1580 user_manager()->FindUser(account_id_B)); 1580 user_manager()->FindUser(account_id_B));
1581 EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive()); 1581 EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive());
1582 EXPECT_EQ(nullptr, wm::GetActiveWindow()); 1582 EXPECT_EQ(nullptr, wm::GetActiveWindow());
1583 EXPECT_EQ(nullptr, ChromeNewWindowClient::GetActiveBrowser()); 1583 EXPECT_EQ(nullptr, ChromeNewWindowClient::GetActiveBrowser());
1584 } 1584 }
1585 1585
1586 } // namespace test 1586 } // namespace test
1587 } // namespace ash 1587 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698