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/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
10 #include "base/test/scoped_path_override.h" | 10 #include "base/test/scoped_path_override.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 service_, profile_.get(), &providers); | 53 service_, profile_.get(), &providers); |
54 | 54 |
55 for (ProviderCollection::iterator i = providers.begin(); | 55 for (ProviderCollection::iterator i = providers.begin(); |
56 i != providers.end(); | 56 i != providers.end(); |
57 ++i) { | 57 ++i) { |
58 service_->AddProviderForTesting(i->release()); | 58 service_->AddProviderForTesting(i->release()); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 // ExtensionServiceTestBase overrides: | 62 // ExtensionServiceTestBase overrides: |
63 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() override { |
64 ExtensionServiceTestBase::SetUp(); | 64 ExtensionServiceTestBase::SetUp(); |
65 | 65 |
66 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); | 66 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); |
67 chromeos::ServicesCustomizationDocument::RegisterPrefs( | 67 chromeos::ServicesCustomizationDocument::RegisterPrefs( |
68 local_state_.registry()); | 68 local_state_.registry()); |
69 | 69 |
70 external_externsions_overrides_.reset(new base::ScopedPathOverride( | 70 external_externsions_overrides_.reset(new base::ScopedPathOverride( |
71 chrome::DIR_EXTERNAL_EXTENSIONS, data_dir().Append("external"))); | 71 chrome::DIR_EXTERNAL_EXTENSIONS, data_dir().Append("external"))); |
72 | 72 |
73 chromeos::system::StatisticsProvider::SetTestProvider( | 73 chromeos::system::StatisticsProvider::SetTestProvider( |
74 &mock_statistics_provider_); | 74 &mock_statistics_provider_); |
75 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) | 75 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) |
76 .WillRepeatedly(Return(false)); | 76 .WillRepeatedly(Return(false)); |
77 } | 77 } |
78 | 78 |
79 virtual void TearDown() OVERRIDE { | 79 virtual void TearDown() override { |
80 chromeos::KioskAppManager::Shutdown(); | 80 chromeos::KioskAppManager::Shutdown(); |
81 chromeos::system::StatisticsProvider::SetTestProvider(NULL); | 81 chromeos::system::StatisticsProvider::SetTestProvider(NULL); |
82 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); | 82 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 TestingPrefServiceSimple local_state_; | 86 TestingPrefServiceSimple local_state_; |
87 scoped_ptr<base::ScopedPathOverride> external_externsions_overrides_; | 87 scoped_ptr<base::ScopedPathOverride> external_externsions_overrides_; |
88 chromeos::system::MockStatisticsProvider mock_statistics_provider_; | 88 chromeos::system::MockStatisticsProvider mock_statistics_provider_; |
89 chromeos::FakeUserManager* fake_user_manager_; | 89 chromeos::FakeUserManager* fake_user_manager_; |
(...skipping 24 matching lines...) Expand all Loading... |
114 | 114 |
115 InitServiceWithExternalProviders(); | 115 InitServiceWithExternalProviders(); |
116 | 116 |
117 service_->CheckForExternalUpdates(); | 117 service_->CheckForExternalUpdates(); |
118 base::RunLoop().RunUntilIdle(); | 118 base::RunLoop().RunUntilIdle(); |
119 | 119 |
120 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); | 120 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); |
121 } | 121 } |
122 | 122 |
123 } // namespace extensions | 123 } // namespace extensions |
OLD | NEW |