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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2644733004: Chrome OS: New window on teleported browser window should show on current desktop (Closed)
Patch Set: remove unused include Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/multi_user/multi_user_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2818 launcher_controller_.get(), item_browser, 0, NULL, true)); 2818 launcher_controller_.get(), item_browser, 0, NULL, true));
2819 2819
2820 // Show the created |browser()| by showing its window. 2820 // Show the created |browser()| by showing its window.
2821 browser()->window()->Show(); 2821 browser()->window()->Show();
2822 base::string16 title1 = ASCIIToUTF16("Test1"); 2822 base::string16 title1 = ASCIIToUTF16("Test1");
2823 NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1); 2823 NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1);
2824 base::string16 one_menu_item1[] = { title1 }; 2824 base::string16 one_menu_item1[] = { title1 };
2825 EXPECT_TRUE(CheckMenuCreation( 2825 EXPECT_TRUE(CheckMenuCreation(
2826 launcher_controller_.get(), item_browser, 1, one_menu_item1, true)); 2826 launcher_controller_.get(), item_browser, 1, one_menu_item1, true));
2827 2827
2828 // Create a browser for another user and check that it is not included in the 2828 // Switch to another user's desktop and create a browser.
2829 // users running browser list.
2830 std::string user2 = "user2"; 2829 std::string user2 = "user2";
2831 TestingProfile* profile2 = CreateMultiUserProfile(user2); 2830 TestingProfile* profile2 = CreateMultiUserProfile(user2);
2832 const AccountId account_id2( 2831 const AccountId account_id2(
2833 multi_user_util::GetAccountIdFromProfile(profile2)); 2832 multi_user_util::GetAccountIdFromProfile(profile2));
2833 SwitchActiveUser(account_id2);
2834 std::unique_ptr<Browser> browser2( 2834 std::unique_ptr<Browser> browser2(
2835 CreateBrowserAndTabWithProfile(profile2, user2, "http://test2")); 2835 CreateBrowserAndTabWithProfile(profile2, user2, "http://test2"));
Qiang(Joe) Xu 2017/01/19 21:54:33 This is to create a visiting(teleported) browser2
2836 base::string16 one_menu_item2[] = { ASCIIToUTF16(user2) }; 2836 base::string16 one_menu_item2[] = { ASCIIToUTF16(user2) };
2837 EXPECT_TRUE(CheckMenuCreation( 2837 EXPECT_TRUE(CheckMenuCreation(
2838 launcher_controller_.get(), item_browser, 1, one_menu_item1, true));
2839
2840 // Switch to the other user and make sure that only that browser window gets
2841 // shown.
2842 SwitchActiveUser(account_id2);
2843 EXPECT_TRUE(CheckMenuCreation(
2844 launcher_controller_.get(), item_browser, 1, one_menu_item2, true)); 2838 launcher_controller_.get(), item_browser, 1, one_menu_item2, true));
2845 2839
2846 // Transferred browsers of other users should not show up in the list. 2840 // Transferred browsers of other users should not show up in the list.
2847 chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser( 2841 chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser(
2848 browser()->window()->GetNativeWindow(), account_id2); 2842 browser()->window()->GetNativeWindow(), account_id2);
2849 EXPECT_TRUE(CheckMenuCreation( 2843 EXPECT_TRUE(CheckMenuCreation(
2850 launcher_controller_.get(), item_browser, 1, one_menu_item2, true)); 2844 launcher_controller_.get(), item_browser, 1, one_menu_item2, true));
2851 2845
2852 chrome::CloseTab(browser2.get()); 2846 chrome::CloseTab(browser2.get());
2853 } 2847 }
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4063 4057
4064 // Pinned state should not change. 4058 // Pinned state should not change.
4065 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 4059 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
4066 launcher_controller_->UnpinAppWithID(extension2_->id()); 4060 launcher_controller_->UnpinAppWithID(extension2_->id());
4067 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); 4061 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus());
4068 4062
4069 // Resume syncing and sync information overrides local copy. 4063 // Resume syncing and sync information overrides local copy.
4070 StartAppSyncService(copy_sync_list); 4064 StartAppSyncService(copy_sync_list);
4071 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 4065 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
4072 } 4066 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/multi_user/multi_user_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698