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 3554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3565 launcher_controller_.get()); | 3565 launcher_controller_.get()); |
3566 | 3566 |
3567 // Initial run, Arc is not managed and disabled, Play Store pin should be | 3567 // Initial run, Arc is not managed and disabled, Play Store pin should be |
3568 // available. | 3568 // available. |
3569 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, | 3569 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, |
3570 "AppList, Chrome, Play Store"); | 3570 "AppList, Chrome, Play Store"); |
3571 | 3571 |
3572 // Arc is managed and enabled, Play Store pin should be available. | 3572 // Arc is managed and enabled, Play Store pin should be available. |
3573 // Note: SHOWING_TERMS_OF_SERVICE here means that opt-in flow starts. | 3573 // Note: SHOWING_TERMS_OF_SERVICE here means that opt-in flow starts. |
3574 profile()->GetTestingPrefService()->SetManagedPref( | 3574 profile()->GetTestingPrefService()->SetManagedPref( |
3575 prefs::kArcEnabled, new base::FundamentalValue(true)); | 3575 prefs::kArcEnabled, new base::Value(true)); |
3576 base::RunLoop().RunUntilIdle(); | 3576 base::RunLoop().RunUntilIdle(); |
3577 ValidateArcState(true, true, | 3577 ValidateArcState(true, true, |
3578 arc::ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, | 3578 arc::ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, |
3579 "AppList, Chrome, Play Store"); | 3579 "AppList, Chrome, Play Store"); |
3580 | 3580 |
3581 // Arc is managed and disabled, Play Store pin should not be available. | 3581 // Arc is managed and disabled, Play Store pin should not be available. |
3582 profile()->GetTestingPrefService()->SetManagedPref( | 3582 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled, |
3583 prefs::kArcEnabled, new base::FundamentalValue(false)); | 3583 new base::Value(false)); |
3584 base::RunLoop().RunUntilIdle(); | 3584 base::RunLoop().RunUntilIdle(); |
3585 ValidateArcState(false, true, arc::ArcSessionManager::State::STOPPED, | 3585 ValidateArcState(false, true, arc::ArcSessionManager::State::STOPPED, |
3586 "AppList, Chrome"); | 3586 "AppList, Chrome"); |
3587 | 3587 |
3588 // Arc is not managed and disabled, Play Store pin should be available. | 3588 // Arc is not managed and disabled, Play Store pin should be available. |
3589 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); | 3589 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); |
3590 base::RunLoop().RunUntilIdle(); | 3590 base::RunLoop().RunUntilIdle(); |
3591 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, | 3591 ValidateArcState(false, false, arc::ArcSessionManager::State::STOPPED, |
3592 "AppList, Chrome, Play Store"); | 3592 "AppList, Chrome, Play Store"); |
3593 | 3593 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4030 | 4030 |
4031 // Pinned state should not change. | 4031 // Pinned state should not change. |
4032 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4032 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
4033 launcher_controller_->UnpinAppWithID(extension2_->id()); | 4033 launcher_controller_->UnpinAppWithID(extension2_->id()); |
4034 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); | 4034 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); |
4035 | 4035 |
4036 // Resume syncing and sync information overrides local copy. | 4036 // Resume syncing and sync information overrides local copy. |
4037 StartAppSyncService(copy_sync_list); | 4037 StartAppSyncService(copy_sync_list); |
4038 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4038 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
4039 } | 4039 } |
OLD | NEW |