Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 2907493002: ChromeOS: Per-user time zone: refactor tests first. (Closed)
Patch Set: Fix debug build Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
31 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
32 #include "chrome/browser/favicon/favicon_service_factory.h" 33 #include "chrome/browser/favicon/favicon_service_factory.h"
33 #include "chrome/browser/history/chrome_history_client.h" 34 #include "chrome/browser/history/chrome_history_client.h"
34 #include "chrome/browser/history/history_service_factory.h" 35 #include "chrome/browser/history/history_service_factory.h"
35 #include "chrome/browser/history/web_history_service_factory.h" 36 #include "chrome/browser/history/web_history_service_factory.h"
36 #include "chrome/browser/net/proxy_service_factory.h" 37 #include "chrome/browser/net/proxy_service_factory.h"
37 #include "chrome/browser/policy/profile_policy_connector.h" 38 #include "chrome/browser/policy/profile_policy_connector.h"
38 #include "chrome/browser/policy/profile_policy_connector_factory.h" 39 #include "chrome/browser/policy/profile_policy_connector_factory.h"
39 #include "chrome/browser/policy/schema_registry_service.h" 40 #include "chrome/browser/policy/schema_registry_service.h"
40 #include "chrome/browser/policy/schema_registry_service_factory.h" 41 #include "chrome/browser/policy/schema_registry_service_factory.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 420 }
420 } 421 }
421 422
422 void TestingProfile::Init() { 423 void TestingProfile::Init() {
423 base::ThreadRestrictions::ScopedAllowIO allow_io; 424 base::ThreadRestrictions::ScopedAllowIO allow_io;
424 // If threads have been initialized, we should be on the UI thread. 425 // If threads have been initialized, we should be on the UI thread.
425 DCHECK(!content::BrowserThread::IsThreadInitialized( 426 DCHECK(!content::BrowserThread::IsThreadInitialized(
426 content::BrowserThread::UI) || 427 content::BrowserThread::UI) ||
427 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 428 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
428 429
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
429 set_is_guest_profile(guest_session_); 437 set_is_guest_profile(guest_session_);
430 438
431 BrowserContext::Initialize(this, profile_path_); 439 BrowserContext::Initialize(this, profile_path_);
432 440
433 browser_context_dependency_manager_->MarkBrowserContextLive(this); 441 browser_context_dependency_manager_->MarkBrowserContextLive(this);
434 442
435 #if defined(OS_ANDROID) 443 #if defined(OS_ANDROID)
436 // Make sure token service knows its running in tests. 444 // Make sure token service knows its running in tests.
437 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); 445 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile();
438 #endif 446 #endif
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // Note: Owned by |original_profile|. 1124 // Note: Owned by |original_profile|.
1117 return new TestingProfile(path_, delegate_, 1125 return new TestingProfile(path_, delegate_,
1118 #if BUILDFLAG(ENABLE_EXTENSIONS) 1126 #if BUILDFLAG(ENABLE_EXTENSIONS)
1119 extension_policy_, 1127 extension_policy_,
1120 #endif 1128 #endif
1121 std::move(pref_service_), original_profile, 1129 std::move(pref_service_), original_profile,
1122 guest_session_, supervised_user_id_, 1130 guest_session_, supervised_user_id_,
1123 std::move(policy_service_), testing_factories_, 1131 std::move(policy_service_), testing_factories_,
1124 profile_name_); 1132 profile_name_);
1125 } 1133 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698