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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/prefs/browser_prefs.h" | 39 #include "chrome/browser/prefs/browser_prefs.h" |
40 #include "chrome/browser/prefs/pref_service_syncable.h" | 40 #include "chrome/browser/prefs/pref_service_syncable.h" |
41 #include "chrome/browser/prerender/prerender_manager.h" | 41 #include "chrome/browser/prerender/prerender_manager.h" |
42 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 42 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
43 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
44 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 44 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
46 #include "chrome/browser/webdata/web_data_service_factory.h" | 46 #include "chrome/browser/webdata/web_data_service_factory.h" |
47 #include "chrome/common/chrome_constants.h" | 47 #include "chrome/common/chrome_constants.h" |
48 #include "chrome/common/chrome_switches.h" | 48 #include "chrome/common/chrome_switches.h" |
| 49 #include "chrome/common/content_settings_component.h" |
49 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
50 #include "chrome/common/url_constants.h" | 51 #include "chrome/common/url_constants.h" |
51 #include "chrome/test/base/history_index_restore_observer.h" | 52 #include "chrome/test/base/history_index_restore_observer.h" |
52 #include "chrome/test/base/testing_pref_service_syncable.h" | 53 #include "chrome/test/base/testing_pref_service_syncable.h" |
53 #include "chrome/test/base/ui_test_utils.h" | 54 #include "chrome/test/base/ui_test_utils.h" |
54 #include "components/bookmarks/browser/bookmark_model.h" | 55 #include "components/bookmarks/browser/bookmark_model.h" |
55 #include "components/bookmarks/common/bookmark_constants.h" | 56 #include "components/bookmarks/common/bookmark_constants.h" |
56 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 57 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
57 #include "components/policy/core/common/policy_service.h" | 58 #include "components/policy/core/common/policy_service.h" |
58 #include "components/user_prefs/user_prefs.h" | 59 #include "components/user_prefs/user_prefs.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 324 } |
324 } | 325 } |
325 } | 326 } |
326 | 327 |
327 void TestingProfile::Init() { | 328 void TestingProfile::Init() { |
328 // If threads have been initialized, we should be on the UI thread. | 329 // If threads have been initialized, we should be on the UI thread. |
329 DCHECK(!content::BrowserThread::IsThreadInitialized( | 330 DCHECK(!content::BrowserThread::IsThreadInitialized( |
330 content::BrowserThread::UI) || | 331 content::BrowserThread::UI) || |
331 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 332 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
332 | 333 |
| 334 InitContentSettingsComponent(); |
| 335 |
333 #if defined(OS_ANDROID) | 336 #if defined(OS_ANDROID) |
334 // Make sure token service knows its running in tests. | 337 // Make sure token service knows its running in tests. |
335 AndroidProfileOAuth2TokenService::set_is_testing_profile(); | 338 AndroidProfileOAuth2TokenService::set_is_testing_profile(); |
336 #endif | 339 #endif |
337 | 340 |
338 // Normally this would happen during browser startup, but for tests | 341 // Normally this would happen during browser startup, but for tests |
339 // we need to trigger creation of Profile-related services. | 342 // we need to trigger creation of Profile-related services. |
340 ChromeBrowserMainExtraPartsProfiles:: | 343 ChromeBrowserMainExtraPartsProfiles:: |
341 EnsureBrowserContextKeyedServiceFactoriesBuilt(); | 344 EnsureBrowserContextKeyedServiceFactoriesBuilt(); |
342 | 345 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 #if defined(ENABLE_EXTENSIONS) | 985 #if defined(ENABLE_EXTENSIONS) |
983 extension_policy_, | 986 extension_policy_, |
984 #endif | 987 #endif |
985 pref_service_.Pass(), | 988 pref_service_.Pass(), |
986 incognito_, | 989 incognito_, |
987 guest_session_, | 990 guest_session_, |
988 supervised_user_id_, | 991 supervised_user_id_, |
989 policy_service_.Pass(), | 992 policy_service_.Pass(), |
990 testing_factories_)); | 993 testing_factories_)); |
991 } | 994 } |
OLD | NEW |