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/extensions/external_provider_impl.h" | 13 #include "chrome/browser/extensions/external_provider_impl.h" |
14 #include "chrome/browser/prefs/browser_prefs.h" | 14 #include "chrome/browser/prefs/browser_prefs.h" |
15 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 15 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
16 #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" |
17 #include "chrome/test/base/testing_browser_process.h" | 17 #include "chrome/test/base/testing_browser_process.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 #include "chromeos/dbus/dbus_thread_manager.h" | 19 #include "chromeos/dbus/dbus_thread_manager.h" |
20 #include "chromeos/network/network_handler.h" | 20 #include "chromeos/network/network_handler.h" |
21 #include "chromeos/network/network_state.h" | 21 #include "chromeos/network/network_state.h" |
22 #include "chromeos/network/network_state_handler.h" | 22 #include "chromeos/network/network_state_handler.h" |
23 #include "chromeos/system/fake_statistics_provider.h" | 23 #include "chromeos/system/fake_statistics_provider.h" |
24 #include "components/pref_registry/pref_registry_syncable.h" | 24 #include "components/pref_registry/pref_registry_syncable.h" |
25 #include "components/prefs/testing_pref_service.h" | 25 #include "components/prefs/testing_pref_service.h" |
26 #include "components/syncable_prefs/pref_service_mock_factory.h" | 26 #include "components/sync_preferences/pref_service_mock_factory.h" |
27 #include "components/syncable_prefs/pref_service_syncable.h" | 27 #include "components/sync_preferences/pref_service_syncable.h" |
28 #include "content/public/test/test_browser_thread_bundle.h" | 28 #include "content/public/test/test_browser_thread_bundle.h" |
29 #include "extensions/browser/external_install_info.h" | 29 #include "extensions/browser/external_install_info.h" |
30 #include "extensions/common/extension.h" | 30 #include "extensions/common/extension.h" |
31 #include "extensions/common/manifest.h" | 31 #include "extensions/common/manifest.h" |
32 #include "net/http/http_response_headers.h" | 32 #include "net/http/http_response_headers.h" |
33 #include "net/http/http_status_code.h" | 33 #include "net/http/http_status_code.h" |
34 #include "net/url_request/test_url_fetcher_factory.h" | 34 #include "net/url_request/test_url_fetcher_factory.h" |
35 #include "net/url_request/url_request_status.h" | 35 #include "net/url_request/url_request_status.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 std::string(), | 274 std::string(), |
275 net::HTTP_NOT_FOUND, | 275 net::HTTP_NOT_FOUND, |
276 net::URLRequestStatus::SUCCESS); | 276 net::URLRequestStatus::SUCCESS); |
277 EXPECT_CALL(url_callback_, OnRequestCreate(url, _)) | 277 EXPECT_CALL(url_callback_, OnRequestCreate(url, _)) |
278 .Times(Exactly(1)) | 278 .Times(Exactly(1)) |
279 .WillRepeatedly(Invoke(AddMimeHeader)); | 279 .WillRepeatedly(Invoke(AddMimeHeader)); |
280 } | 280 } |
281 | 281 |
282 std::unique_ptr<TestingProfile> CreateProfile() { | 282 std::unique_ptr<TestingProfile> CreateProfile() { |
283 TestingProfile::Builder profile_builder; | 283 TestingProfile::Builder profile_builder; |
284 syncable_prefs::PrefServiceMockFactory factory; | 284 sync_preferences::PrefServiceMockFactory factory; |
285 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 285 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
286 new user_prefs::PrefRegistrySyncable); | 286 new user_prefs::PrefRegistrySyncable); |
287 std::unique_ptr<syncable_prefs::PrefServiceSyncable> prefs( | 287 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs( |
288 factory.CreateSyncable(registry.get())); | 288 factory.CreateSyncable(registry.get())); |
289 chrome::RegisterUserProfilePrefs(registry.get()); | 289 chrome::RegisterUserProfilePrefs(registry.get()); |
290 profile_builder.SetPrefService(std::move(prefs)); | 290 profile_builder.SetPrefService(std::move(prefs)); |
291 return profile_builder.Build(); | 291 return profile_builder.Build(); |
292 } | 292 } |
293 | 293 |
294 private: | 294 private: |
295 system::ScopedFakeStatisticsProvider fake_statistics_provider_; | 295 system::ScopedFakeStatisticsProvider fake_statistics_provider_; |
296 content::TestBrowserThreadBundle thread_bundle_; | 296 content::TestBrowserThreadBundle thread_bundle_; |
297 TestingPrefServiceSimple local_state_; | 297 TestingPrefServiceSimple local_state_; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _)).Times(0); | 457 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _)).Times(0); |
458 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 458 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
459 .Times(1); | 459 .Times(1); |
460 EXPECT_CALL(visitor, OnExternalProviderUpdateComplete(_, _, _, _)).Times(0); | 460 EXPECT_CALL(visitor, OnExternalProviderUpdateComplete(_, _, _, _)).Times(0); |
461 | 461 |
462 RunUntilIdle(); | 462 RunUntilIdle(); |
463 EXPECT_TRUE(doc->IsReady()); | 463 EXPECT_TRUE(doc->IsReady()); |
464 } | 464 } |
465 | 465 |
466 } // namespace chromeos | 466 } // namespace chromeos |
OLD | NEW |