| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/customization/customization_document.h" | 5 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 12 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
| 13 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" | |
| 14 #include "chrome/browser/extensions/external_provider_impl.h" | 13 #include "chrome/browser/extensions/external_provider_impl.h" |
| 15 #include "chrome/browser/prefs/browser_prefs.h" | 14 #include "chrome/browser/prefs/browser_prefs.h" |
| 16 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 15 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 17 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 16 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 18 #include "chrome/test/base/testing_browser_process.h" | 17 #include "chrome/test/base/testing_browser_process.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 20 #include "chromeos/dbus/dbus_thread_manager.h" | 19 #include "chromeos/dbus/dbus_thread_manager.h" |
| 21 #include "chromeos/network/network_handler.h" | 20 #include "chromeos/network/network_handler.h" |
| 22 #include "chromeos/network/network_state.h" | 21 #include "chromeos/network/network_state.h" |
| 23 #include "chromeos/network/network_state_handler.h" | 22 #include "chromeos/network/network_state_handler.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 new user_prefs::PrefRegistrySyncable); | 286 new user_prefs::PrefRegistrySyncable); |
| 288 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs( | 287 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs( |
| 289 factory.CreateSyncable(registry.get())); | 288 factory.CreateSyncable(registry.get())); |
| 290 chrome::RegisterUserProfilePrefs(registry.get()); | 289 chrome::RegisterUserProfilePrefs(registry.get()); |
| 291 profile_builder.SetPrefService(std::move(prefs)); | 290 profile_builder.SetPrefService(std::move(prefs)); |
| 292 return profile_builder.Build(); | 291 return profile_builder.Build(); |
| 293 } | 292 } |
| 294 | 293 |
| 295 private: | 294 private: |
| 296 system::ScopedFakeStatisticsProvider fake_statistics_provider_; | 295 system::ScopedFakeStatisticsProvider fake_statistics_provider_; |
| 297 ScopedCrosSettingsTestHelper scoped_cros_settings_test_helper_; | |
| 298 content::TestBrowserThreadBundle thread_bundle_; | 296 content::TestBrowserThreadBundle thread_bundle_; |
| 299 TestingPrefServiceSimple local_state_; | 297 TestingPrefServiceSimple local_state_; |
| 300 TestURLFetcherCallback url_callback_; | 298 TestURLFetcherCallback url_callback_; |
| 301 net::FakeURLFetcherFactory factory_; | 299 net::FakeURLFetcherFactory factory_; |
| 302 NetworkPortalDetectorTestImpl network_portal_detector_; | 300 NetworkPortalDetectorTestImpl network_portal_detector_; |
| 303 }; | 301 }; |
| 304 | 302 |
| 305 TEST_F(ServicesCustomizationDocumentTest, Basic) { | 303 TEST_F(ServicesCustomizationDocumentTest, Basic) { |
| 306 AddCustomizationIdToVp(kDummyCustomizationID); | 304 AddCustomizationIdToVp(kDummyCustomizationID); |
| 307 AddExpectedManifest(kDummyCustomizationID, kGoodServicesManifest); | 305 AddExpectedManifest(kDummyCustomizationID, kGoodServicesManifest); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _)).Times(0); | 457 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _)).Times(0); |
| 460 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 458 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
| 461 .Times(1); | 459 .Times(1); |
| 462 EXPECT_CALL(visitor, OnExternalProviderUpdateComplete(_, _, _, _)).Times(0); | 460 EXPECT_CALL(visitor, OnExternalProviderUpdateComplete(_, _, _, _)).Times(0); |
| 463 | 461 |
| 464 RunUntilIdle(); | 462 RunUntilIdle(); |
| 465 EXPECT_TRUE(doc->IsReady()); | 463 EXPECT_TRUE(doc->IsReady()); |
| 466 } | 464 } |
| 467 | 465 |
| 468 } // namespace chromeos | 466 } // namespace chromeos |
| OLD | NEW |