| 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" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/chromeos/customization_document.h" | 12 #include "chrome/browser/chromeos/customization_document.h" |
| 13 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" | 13 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" |
| 14 #include "chrome/browser/extensions/extension_service_unittest.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 15 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 19 #include "chromeos/system/mock_statistics_provider.h" | 20 #include "chromeos/system/mock_statistics_provider.h" |
| 20 #include "chromeos/system/statistics_provider.h" | 21 #include "chromeos/system/statistics_provider.h" |
| 21 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 22 #include "content/public/test/test_utils.h" | 23 #include "content/public/test/test_utils.h" |
| 23 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
| 24 | 25 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 58 } |
| 58 | 59 |
| 59 // ExtensionServiceTestBase overrides: | 60 // ExtensionServiceTestBase overrides: |
| 60 virtual void SetUp() OVERRIDE { | 61 virtual void SetUp() OVERRIDE { |
| 61 ExtensionServiceTestBase::SetUp(); | 62 ExtensionServiceTestBase::SetUp(); |
| 62 | 63 |
| 63 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); | 64 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); |
| 64 chromeos::ServicesCustomizationDocument::RegisterPrefs( | 65 chromeos::ServicesCustomizationDocument::RegisterPrefs( |
| 65 local_state_.registry()); | 66 local_state_.registry()); |
| 66 | 67 |
| 67 external_externsions_overrides_.reset( | 68 external_externsions_overrides_.reset(new base::ScopedPathOverride( |
| 68 new base::ScopedPathOverride(chrome::DIR_EXTERNAL_EXTENSIONS, | 69 chrome::DIR_EXTERNAL_EXTENSIONS, data_dir().Append("external"))); |
| 69 data_dir_.Append("external"))); | |
| 70 | 70 |
| 71 chromeos::system::StatisticsProvider::SetTestProvider( | 71 chromeos::system::StatisticsProvider::SetTestProvider( |
| 72 &mock_statistics_provider_); | 72 &mock_statistics_provider_); |
| 73 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) | 73 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) |
| 74 .WillRepeatedly(Return(false)); | 74 .WillRepeatedly(Return(false)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void TearDown() OVERRIDE { | 77 virtual void TearDown() OVERRIDE { |
| 78 chromeos::system::StatisticsProvider::SetTestProvider(NULL); | 78 chromeos::system::StatisticsProvider::SetTestProvider(NULL); |
| 79 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); | 79 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 InitServiceWithExternalProviders(); | 112 InitServiceWithExternalProviders(); |
| 113 | 113 |
| 114 service_->CheckForExternalUpdates(); | 114 service_->CheckForExternalUpdates(); |
| 115 base::RunLoop().RunUntilIdle(); | 115 base::RunLoop().RunUntilIdle(); |
| 116 | 116 |
| 117 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); | 117 EXPECT_FALSE(service_->GetInstalledExtension(kExternalAppId)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace extensions | 120 } // namespace extensions |
| OLD | NEW |