OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
23 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" | 23 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" |
24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
25 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 25 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
26 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 26 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" | 28 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
29 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_fac
tory.h" | 29 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_fac
tory.h" |
30 #include "chrome/browser/chrome_notification_types.h" | 30 #include "chrome/browser/chrome_notification_types.h" |
31 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 31 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
33 #include "chrome/browser/favicon/favicon_service_factory.h" | 32 #include "chrome/browser/favicon/favicon_service_factory.h" |
34 #include "chrome/browser/history/chrome_history_client.h" | 33 #include "chrome/browser/history/chrome_history_client.h" |
35 #include "chrome/browser/history/history_service_factory.h" | 34 #include "chrome/browser/history/history_service_factory.h" |
36 #include "chrome/browser/history/web_history_service_factory.h" | 35 #include "chrome/browser/history/web_history_service_factory.h" |
37 #include "chrome/browser/net/proxy_service_factory.h" | 36 #include "chrome/browser/net/proxy_service_factory.h" |
38 #include "chrome/browser/policy/profile_policy_connector.h" | 37 #include "chrome/browser/policy/profile_policy_connector.h" |
39 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 38 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
40 #include "chrome/browser/policy/schema_registry_service.h" | 39 #include "chrome/browser/policy/schema_registry_service.h" |
41 #include "chrome/browser/policy/schema_registry_service_factory.h" | 40 #include "chrome/browser/policy/schema_registry_service_factory.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 419 } |
421 } | 420 } |
422 | 421 |
423 void TestingProfile::Init() { | 422 void TestingProfile::Init() { |
424 base::ThreadRestrictions::ScopedAllowIO allow_io; | 423 base::ThreadRestrictions::ScopedAllowIO allow_io; |
425 // If threads have been initialized, we should be on the UI thread. | 424 // If threads have been initialized, we should be on the UI thread. |
426 DCHECK(!content::BrowserThread::IsThreadInitialized( | 425 DCHECK(!content::BrowserThread::IsThreadInitialized( |
427 content::BrowserThread::UI) || | 426 content::BrowserThread::UI) || |
428 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 427 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
429 | 428 |
430 #if defined(OS_CHROMEOS) | |
431 if (!chromeos::CrosSettings::IsInitialized()) { | |
432 scoped_cros_settings_test_helper_.reset( | |
433 new chromeos::ScopedCrosSettingsTestHelper); | |
434 } | |
435 #endif | |
436 | |
437 set_is_guest_profile(guest_session_); | 429 set_is_guest_profile(guest_session_); |
438 | 430 |
439 BrowserContext::Initialize(this, profile_path_); | 431 BrowserContext::Initialize(this, profile_path_); |
440 | 432 |
441 browser_context_dependency_manager_->MarkBrowserContextLive(this); | 433 browser_context_dependency_manager_->MarkBrowserContextLive(this); |
442 | 434 |
443 #if defined(OS_ANDROID) | 435 #if defined(OS_ANDROID) |
444 // Make sure token service knows its running in tests. | 436 // Make sure token service knows its running in tests. |
445 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); | 437 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); |
446 #endif | 438 #endif |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 // Note: Owned by |original_profile|. | 1116 // Note: Owned by |original_profile|. |
1125 return new TestingProfile(path_, delegate_, | 1117 return new TestingProfile(path_, delegate_, |
1126 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1118 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1127 extension_policy_, | 1119 extension_policy_, |
1128 #endif | 1120 #endif |
1129 std::move(pref_service_), original_profile, | 1121 std::move(pref_service_), original_profile, |
1130 guest_session_, supervised_user_id_, | 1122 guest_session_, supervised_user_id_, |
1131 std::move(policy_service_), testing_factories_, | 1123 std::move(policy_service_), testing_factories_, |
1132 profile_name_); | 1124 profile_name_); |
1133 } | 1125 } |
OLD | NEW |