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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 392 } |
393 | 393 |
394 void TestingProfile::Init() { | 394 void TestingProfile::Init() { |
395 // If threads have been initialized, we should be on the UI thread. | 395 // If threads have been initialized, we should be on the UI thread. |
396 DCHECK(!content::BrowserThread::IsThreadInitialized( | 396 DCHECK(!content::BrowserThread::IsThreadInitialized( |
397 content::BrowserThread::UI) || | 397 content::BrowserThread::UI) || |
398 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 398 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
399 | 399 |
400 set_is_guest_profile(guest_session_); | 400 set_is_guest_profile(guest_session_); |
401 | 401 |
| 402 BrowserContext::Initialize(this, profile_path_); |
| 403 |
402 #if defined(OS_ANDROID) | 404 #if defined(OS_ANDROID) |
403 // Make sure token service knows its running in tests. | 405 // Make sure token service knows its running in tests. |
404 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); | 406 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); |
405 #endif | 407 #endif |
406 | 408 |
407 // Normally this would happen during browser startup, but for tests | 409 // Normally this would happen during browser startup, but for tests |
408 // we need to trigger creation of Profile-related services. | 410 // we need to trigger creation of Profile-related services. |
409 ChromeBrowserMainExtraPartsProfiles:: | 411 ChromeBrowserMainExtraPartsProfiles:: |
410 EnsureBrowserContextKeyedServiceFactoriesBuilt(); | 412 EnsureBrowserContextKeyedServiceFactoriesBuilt(); |
411 | 413 |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 | 1042 |
1041 // Note: Owned by |original_profile|. | 1043 // Note: Owned by |original_profile|. |
1042 return new TestingProfile(path_, delegate_, | 1044 return new TestingProfile(path_, delegate_, |
1043 #if defined(ENABLE_EXTENSIONS) | 1045 #if defined(ENABLE_EXTENSIONS) |
1044 extension_policy_, | 1046 extension_policy_, |
1045 #endif | 1047 #endif |
1046 std::move(pref_service_), original_profile, | 1048 std::move(pref_service_), original_profile, |
1047 guest_session_, supervised_user_id_, | 1049 guest_session_, supervised_user_id_, |
1048 std::move(policy_service_), testing_factories_); | 1050 std::move(policy_service_), testing_factories_); |
1049 } | 1051 } |
OLD | NEW |