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 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 // of removing pinned icon in ArcSessionManager::OnOptInPreferenceChanged(). | 3632 // of removing pinned icon in ArcSessionManager::OnOptInPreferenceChanged(). |
3633 SetShelfDelegate(); | 3633 SetShelfDelegate(); |
3634 | 3634 |
3635 // Initial run, ARC is not managed and disabled, Play Store pin should be | 3635 // Initial run, ARC is not managed and disabled, Play Store pin should be |
3636 // available. | 3636 // available. |
3637 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, | 3637 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, |
3638 "AppList, Chrome, Play Store"); | 3638 "AppList, Chrome, Play Store"); |
3639 | 3639 |
3640 // ARC is managed and enabled, Play Store pin should be available. | 3640 // ARC is managed and enabled, Play Store pin should be available. |
3641 // Note: SHOWING_TERMS_OF_SERVICE here means that opt-in flow starts. | 3641 // Note: SHOWING_TERMS_OF_SERVICE here means that opt-in flow starts. |
3642 profile()->GetTestingPrefService()->SetManagedPref( | 3642 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled, |
3643 prefs::kArcEnabled, new base::FundamentalValue(true)); | 3643 new base::Value(true)); |
3644 base::RunLoop().RunUntilIdle(); | 3644 base::RunLoop().RunUntilIdle(); |
3645 ValidateArcState(true, true, | 3645 ValidateArcState(true, true, |
3646 arc::ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, | 3646 arc::ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, |
3647 "AppList, Chrome, Play Store"); | 3647 "AppList, Chrome, Play Store"); |
3648 | 3648 |
3649 // ARC is managed and disabled, Play Store pin should not be available. | 3649 // ARC is managed and disabled, Play Store pin should not be available. |
3650 profile()->GetTestingPrefService()->SetManagedPref( | 3650 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled, |
3651 prefs::kArcEnabled, new base::FundamentalValue(false)); | 3651 new base::Value(false)); |
3652 base::RunLoop().RunUntilIdle(); | 3652 base::RunLoop().RunUntilIdle(); |
3653 ValidateArcState(false, true, arc::ArcSessionManager::State::STOPPED, | 3653 ValidateArcState(false, true, arc::ArcSessionManager::State::STOPPED, |
3654 "AppList, Chrome"); | 3654 "AppList, Chrome"); |
3655 | 3655 |
3656 // ARC is not managed and disabled, Play Store pin should be available. | 3656 // ARC is not managed and disabled, Play Store pin should be available. |
3657 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); | 3657 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); |
3658 base::RunLoop().RunUntilIdle(); | 3658 base::RunLoop().RunUntilIdle(); |
3659 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, | 3659 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, |
3660 "AppList, Chrome, Play Store"); | 3660 "AppList, Chrome, Play Store"); |
3661 | 3661 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4245 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 4245 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
4246 shelf_controller->auto_hide()); | 4246 shelf_controller->auto_hide()); |
4247 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); | 4247 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); |
4248 | 4248 |
4249 PrefService* prefs = profile()->GetTestingPrefService(); | 4249 PrefService* prefs = profile()->GetTestingPrefService(); |
4250 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); | 4250 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); |
4251 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); | 4251 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); |
4252 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); | 4252 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); |
4253 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); | 4253 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); |
4254 } | 4254 } |
OLD | NEW |