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

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

Issue 2708923013: Split ArcSessionManager::OnPrimaryUserProfilePrepared(). (Closed)
Patch Set: Created 3 years, 9 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 "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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 EXPECT_TRUE(launcher_controller_->IsAppPinned(extension1_->id())); 2129 EXPECT_TRUE(launcher_controller_->IsAppPinned(extension1_->id()));
2130 EXPECT_TRUE(launcher_controller_->IsAppPinned(arc_app_id)); 2130 EXPECT_TRUE(launcher_controller_->IsAppPinned(arc_app_id));
2131 EXPECT_TRUE(launcher_controller_->IsAppPinned(extension2_->id())); 2131 EXPECT_TRUE(launcher_controller_->IsAppPinned(extension2_->id()));
2132 2132
2133 EXPECT_EQ("AppList, Chrome, App1, Fake App 0, App2", GetPinnedAppStatus()); 2133 EXPECT_EQ("AppList, Chrome, App1, Fake App 0, App2", GetPinnedAppStatus());
2134 UninstallArcApps(); 2134 UninstallArcApps();
2135 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 2135 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
2136 SendListOfArcApps(); 2136 SendListOfArcApps();
2137 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 2137 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
2138 2138
2139 // Disable/Enable ARC should persist pin state. 2139 // Opt-Out/Opt-In remove item from the shelf.
2140 launcher_controller_->PinAppWithID(arc_app_id); 2140 launcher_controller_->PinAppWithID(arc_app_id);
2141 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus()); 2141 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus());
2142 arc::ArcSessionManager::Get()->Shutdown();
hidehiko 2017/02/24 18:29:13 This is unexpected usage. No need to test.
2143 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus());
2144 arc::ArcSessionManager::Get()->OnPrimaryUserProfilePrepared(profile());
2145 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus());
2146
2147 // Opt-Out/Opt-In remove item from the shelf.
2148 EnableArc(false); 2142 EnableArc(false);
2149 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 2143 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
2150 EnableArc(true); 2144 EnableArc(true);
2151 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); 2145 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
2152 SendListOfArcApps(); 2146 SendListOfArcApps();
2153 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus()); 2147 EXPECT_EQ("AppList, Chrome, App1, App2, Fake App 0", GetPinnedAppStatus());
2154 } 2148 }
2155 2149
2156 // Validates that ARC app pins persist across OptOut/OptIn. 2150 // Validates that ARC app pins persist across OptOut/OptIn.
2157 TEST_F(ChromeLauncherControllerImplWithArcTest, ArcAppPinOptOutOptIn) { 2151 TEST_F(ChromeLauncherControllerImplWithArcTest, ArcAppPinOptOutOptIn) {
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
4256 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4250 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4257 shelf_controller->auto_hide()); 4251 shelf_controller->auto_hide());
4258 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4252 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4259 4253
4260 PrefService* prefs = profile()->GetTestingPrefService(); 4254 PrefService* prefs = profile()->GetTestingPrefService();
4261 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4255 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4262 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4256 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4263 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4257 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4264 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4258 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4265 } 4259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698