| OLD | NEW |
| 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/common/shelf/shelf_widget.h" | 7 #include "ash/common/shelf/shelf_widget.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 11 #include "ash/common/wm/mru_window_tracker.h" | 11 #include "ash/common/wm/mru_window_tracker.h" |
| 12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm/wm_event.h" | 13 #include "ash/common/wm/wm_event.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/content/shell_content_state.h" | 16 #include "ash/content/shell_content_state.h" |
| 17 #include "ash/public/cpp/shell_window_ids.h" | 17 #include "ash/public/cpp/shell_window_ids.h" |
| 18 #include "ash/shell.h" | 18 #include "ash/shell.h" |
| 19 #include "ash/test/ash_test_base.h" | 19 #include "ash/test/ash_test_base.h" |
| 20 #include "ash/test/ash_test_environment_content.h" | 20 #include "ash/test/ash_test_environment_content.h" |
| 21 #include "ash/test/ash_test_helper.h" | 21 #include "ash/test/ash_test_helper.h" |
| 22 #include "ash/test/test_shell_delegate.h" | 22 #include "ash/test/test_shell_delegate.h" |
| 23 #include "ash/wm/window_state_aura.h" | 23 #include "ash/wm/window_state_aura.h" |
| 24 #include "ash/wm/window_util.h" | 24 #include "ash/wm/window_util.h" |
| 25 #include "base/compiler_specific.h" | 25 #include "base/compiler_specific.h" |
| 26 #include "base/logging.h" | 26 #include "base/logging.h" |
| 27 #include "base/macros.h" | 27 #include "base/macros.h" |
| 28 #include "base/run_loop.h" | 28 #include "base/run_loop.h" |
| 29 #include "base/strings/string_piece.h" |
| 29 #include "base/strings/string_util.h" | 30 #include "base/strings/string_util.h" |
| 30 #include "base/time/time.h" | 31 #include "base/time/time.h" |
| 31 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 32 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 32 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 33 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 33 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 34 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 34 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 35 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 35 #include "chrome/browser/ui/ash/chrome_new_window_client.h" | 36 #include "chrome/browser/ui/ash/chrome_new_window_client.h" |
| 36 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 37 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 37 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 38 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 38 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 39 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 s += "]"; | 373 s += "]"; |
| 373 } | 374 } |
| 374 return s; | 375 return s; |
| 375 } | 376 } |
| 376 | 377 |
| 377 std::string | 378 std::string |
| 378 MultiUserWindowManagerChromeOSTest::GetOwnersOfVisibleWindowsAsString() { | 379 MultiUserWindowManagerChromeOSTest::GetOwnersOfVisibleWindowsAsString() { |
| 379 std::set<AccountId> owners; | 380 std::set<AccountId> owners; |
| 380 multi_user_window_manager_->GetOwnersOfVisibleWindows(&owners); | 381 multi_user_window_manager_->GetOwnersOfVisibleWindows(&owners); |
| 381 | 382 |
| 382 std::vector<std::string> owner_list; | 383 std::vector<base::StringPiece> owner_list; |
| 383 for (auto& owner : owners) | 384 for (auto& owner : owners) |
| 384 owner_list.push_back(owner.GetUserEmail()); | 385 owner_list.push_back(owner.GetUserEmail()); |
| 385 return base::JoinString(owner_list, " "); | 386 return base::JoinString(owner_list, " "); |
| 386 } | 387 } |
| 387 | 388 |
| 388 // Testing basic assumptions like default state and existence of manager. | 389 // Testing basic assumptions like default state and existence of manager. |
| 389 TEST_F(MultiUserWindowManagerChromeOSTest, BasicTests) { | 390 TEST_F(MultiUserWindowManagerChromeOSTest, BasicTests) { |
| 390 SetUpForThisManyWindows(3); | 391 SetUpForThisManyWindows(3); |
| 391 // Check the basic assumptions: All windows are visible and there is no owner. | 392 // Check the basic assumptions: All windows are visible and there is no owner. |
| 392 EXPECT_EQ("S[], S[], S[]", GetStatus()); | 393 EXPECT_EQ("S[], S[], S[]", GetStatus()); |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 user_manager()->SwitchActiveUser(account_id_B); | 1580 user_manager()->SwitchActiveUser(account_id_B); |
| 1580 multi_user_window_manager()->ActiveUserChanged( | 1581 multi_user_window_manager()->ActiveUserChanged( |
| 1581 user_manager()->FindUser(account_id_B)); | 1582 user_manager()->FindUser(account_id_B)); |
| 1582 EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive()); | 1583 EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive()); |
| 1583 EXPECT_EQ(nullptr, wm::GetActiveWindow()); | 1584 EXPECT_EQ(nullptr, wm::GetActiveWindow()); |
| 1584 EXPECT_EQ(nullptr, ChromeNewWindowClient::GetActiveBrowser()); | 1585 EXPECT_EQ(nullptr, ChromeNewWindowClient::GetActiveBrowser()); |
| 1585 } | 1586 } |
| 1586 | 1587 |
| 1587 } // namespace test | 1588 } // namespace test |
| 1588 } // namespace ash | 1589 } // namespace ash |
| OLD | NEW |