Chromium Code Reviews| 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2840 chrome::NewTab(browser()); | 2840 chrome::NewTab(browser()); |
| 2841 CheckAppMenu(launcher_controller_.get(), item_browser, 0, nullptr); | 2841 CheckAppMenu(launcher_controller_.get(), item_browser, 0, nullptr); |
| 2842 | 2842 |
| 2843 // Show the created |browser()| by showing its window. | 2843 // Show the created |browser()| by showing its window. |
| 2844 browser()->window()->Show(); | 2844 browser()->window()->Show(); |
| 2845 base::string16 title1 = ASCIIToUTF16("Test1"); | 2845 base::string16 title1 = ASCIIToUTF16("Test1"); |
| 2846 NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1); | 2846 NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1); |
| 2847 base::string16 one_menu_item1[] = { title1 }; | 2847 base::string16 one_menu_item1[] = { title1 }; |
| 2848 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item1); | 2848 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item1); |
| 2849 | 2849 |
| 2850 // Create a browser for another user and check that it is not included in the | 2850 // Switch to another user' desktop and create a browser. |
| 2851 // users running browser list. | |
|
Qiang(Joe) Xu
2017/02/08 00:57:36
If we create browser with profile 2, this should b
| |
| 2852 std::string user2 = "user2"; | 2851 std::string user2 = "user2"; |
| 2853 TestingProfile* profile2 = CreateMultiUserProfile(user2); | 2852 TestingProfile* profile2 = CreateMultiUserProfile(user2); |
| 2854 const AccountId account_id2( | 2853 const AccountId account_id2( |
| 2855 multi_user_util::GetAccountIdFromProfile(profile2)); | 2854 multi_user_util::GetAccountIdFromProfile(profile2)); |
| 2855 SwitchActiveUser(account_id2); | |
| 2856 std::unique_ptr<Browser> browser2( | 2856 std::unique_ptr<Browser> browser2( |
| 2857 CreateBrowserAndTabWithProfile(profile2, user2, "http://test2")); | 2857 CreateBrowserAndTabWithProfile(profile2, user2, "http://test2")); |
| 2858 base::string16 one_menu_item2[] = { ASCIIToUTF16(user2) }; | 2858 base::string16 one_menu_item2[] = { ASCIIToUTF16(user2) }; |
| 2859 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item1); | |
| 2860 | |
| 2861 // Switch to the other user and make sure that only that browser window gets | |
| 2862 // shown. | |
| 2863 SwitchActiveUser(account_id2); | |
| 2864 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item2); | 2859 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item2); |
| 2865 | 2860 |
| 2866 // Transferred browsers of other users should not show up in the list. | 2861 // Transferred browsers of other users should not show up in the list. |
| 2867 chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser( | 2862 chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser( |
| 2868 browser()->window()->GetNativeWindow(), account_id2); | 2863 browser()->window()->GetNativeWindow(), account_id2); |
| 2869 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item2); | 2864 CheckAppMenu(launcher_controller_.get(), item_browser, 1, one_menu_item2); |
| 2870 | 2865 |
| 2871 chrome::CloseTab(browser2.get()); | 2866 chrome::CloseTab(browser2.get()); |
| 2872 } | 2867 } |
| 2873 | 2868 |
| (...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4214 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 4209 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
| 4215 shelf_controller->auto_hide()); | 4210 shelf_controller->auto_hide()); |
| 4216 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); | 4211 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); |
| 4217 | 4212 |
| 4218 PrefService* prefs = profile()->GetTestingPrefService(); | 4213 PrefService* prefs = profile()->GetTestingPrefService(); |
| 4219 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); | 4214 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); |
| 4220 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); | 4215 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); |
| 4221 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); | 4216 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); |
| 4222 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); | 4217 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); |
| 4223 } | 4218 } |
| OLD | NEW |