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 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3588 | 3588 |
| 3589 // Initial run, Arc is not managed and disabled, Play Store pin should be | 3589 // Initial run, Arc is not managed and disabled, Play Store pin should be |
| 3590 // available. | 3590 // available. |
| 3591 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, | 3591 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, |
| 3592 "AppList, Chrome, Play Store"); | 3592 "AppList, Chrome, Play Store"); |
| 3593 | 3593 |
| 3594 // Arc is managed and enabled, Play Store pin should be available. | 3594 // Arc is managed and enabled, Play Store pin should be available. |
| 3595 profile()->GetTestingPrefService()->SetManagedPref( | 3595 profile()->GetTestingPrefService()->SetManagedPref( |
| 3596 prefs::kArcEnabled, new base::FundamentalValue(true)); | 3596 prefs::kArcEnabled, new base::FundamentalValue(true)); |
| 3597 base::RunLoop().RunUntilIdle(); | 3597 base::RunLoop().RunUntilIdle(); |
| 3598 ValidateArcState(true, true, arc::ArcAuthService::State::FETCHING_CODE, | 3598 ValidateArcState(true, true, arc::ArcAuthService::State::TERMS, |
|
Mr4D (OOO till 08-26)
2016/11/10 16:12:31
Could you add a comment here towards why there is
hidehiko
2016/11/14 10:55:09
Done.
| |
| 3599 "AppList, Chrome, Play Store"); | 3599 "AppList, Chrome, Play Store"); |
| 3600 | 3600 |
| 3601 // Arc is managed and disabled, Play Store pin should not be available. | 3601 // Arc is managed and disabled, Play Store pin should not be available. |
| 3602 profile()->GetTestingPrefService()->SetManagedPref( | 3602 profile()->GetTestingPrefService()->SetManagedPref( |
| 3603 prefs::kArcEnabled, new base::FundamentalValue(false)); | 3603 prefs::kArcEnabled, new base::FundamentalValue(false)); |
| 3604 base::RunLoop().RunUntilIdle(); | 3604 base::RunLoop().RunUntilIdle(); |
| 3605 ValidateArcState(false, true, arc::ArcAuthService::State::STOPPED, | 3605 ValidateArcState(false, true, arc::ArcAuthService::State::STOPPED, |
| 3606 "AppList, Chrome"); | 3606 "AppList, Chrome"); |
| 3607 | 3607 |
| 3608 // Arc is not managed and disabled, Play Store pin should be available. | 3608 // Arc is not managed and disabled, Play Store pin should be available. |
| 3609 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); | 3609 profile()->GetTestingPrefService()->RemoveManagedPref(prefs::kArcEnabled); |
| 3610 base::RunLoop().RunUntilIdle(); | 3610 base::RunLoop().RunUntilIdle(); |
| 3611 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, | 3611 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, |
| 3612 "AppList, Chrome, Play Store"); | 3612 "AppList, Chrome, Play Store"); |
| 3613 | 3613 |
| 3614 // Arc is not managed and enabled, Play Store pin should be available. | 3614 // Arc is not managed and enabled, Play Store pin should be available. |
| 3615 EnableArc(true); | 3615 EnableArc(true); |
| 3616 ValidateArcState(true, false, arc::ArcAuthService::State::FETCHING_CODE, | 3616 ValidateArcState(true, false, arc::ArcAuthService::State::TERMS, |
| 3617 "AppList, Chrome, Play Store"); | 3617 "AppList, Chrome, Play Store"); |
| 3618 | 3618 |
| 3619 // User disables Arc. Arc is not managed and disabled, Play Store pin should | 3619 // User disables Arc. Arc is not managed and disabled, Play Store pin should |
| 3620 // be automatically removed. | 3620 // be automatically removed. |
| 3621 EnableArc(false); | 3621 EnableArc(false); |
| 3622 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, | 3622 ValidateArcState(false, false, arc::ArcAuthService::State::STOPPED, |
| 3623 "AppList, Chrome"); | 3623 "AppList, Chrome"); |
| 3624 | 3624 |
| 3625 // Even if re-enable it again, Play Store pin does not appear automatically. | 3625 // Even if re-enable it again, Play Store pin does not appear automatically. |
| 3626 EnableArc(true); | 3626 EnableArc(true); |
| 3627 ValidateArcState(true, false, arc::ArcAuthService::State::FETCHING_CODE, | 3627 ValidateArcState(true, false, arc::ArcAuthService::State::TERMS, |
| 3628 "AppList, Chrome"); | 3628 "AppList, Chrome"); |
| 3629 } | 3629 } |
| 3630 | 3630 |
| 3631 namespace { | 3631 namespace { |
| 3632 | 3632 |
| 3633 class ChromeLauncherControllerOrientationTest | 3633 class ChromeLauncherControllerOrientationTest |
| 3634 : public ChromeLauncherControllerImplWithArcTest { | 3634 : public ChromeLauncherControllerImplWithArcTest { |
| 3635 public: | 3635 public: |
| 3636 ChromeLauncherControllerOrientationTest() {} | 3636 ChromeLauncherControllerOrientationTest() {} |
| 3637 ~ChromeLauncherControllerOrientationTest() override {} | 3637 ~ChromeLauncherControllerOrientationTest() override {} |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4044 | 4044 |
| 4045 // Pinned state should not change. | 4045 // Pinned state should not change. |
| 4046 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4046 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
| 4047 launcher_controller_->UnpinAppWithID(extension2_->id()); | 4047 launcher_controller_->UnpinAppWithID(extension2_->id()); |
| 4048 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); | 4048 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); |
| 4049 | 4049 |
| 4050 // Resume syncing and sync information overrides local copy. | 4050 // Resume syncing and sync information overrides local copy. |
| 4051 StartAppSyncService(copy_sync_list); | 4051 StartAppSyncService(copy_sync_list); |
| 4052 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4052 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
| 4053 } | 4053 } |
| OLD | NEW |