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

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

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. Created 3 years, 9 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
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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 void TestingProfile::Init() { 420 void TestingProfile::Init() {
421 // If threads have been initialized, we should be on the UI thread. 421 // If threads have been initialized, we should be on the UI thread.
422 DCHECK(!content::BrowserThread::IsThreadInitialized( 422 DCHECK(!content::BrowserThread::IsThreadInitialized(
423 content::BrowserThread::UI) || 423 content::BrowserThread::UI) ||
424 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 424 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
425 425
426 set_is_guest_profile(guest_session_); 426 set_is_guest_profile(guest_session_);
427 427
428 BrowserContext::Initialize(this, profile_path_); 428 BrowserContext::Initialize(this, profile_path_);
429 429
430 browser_context_dependency_manager_->MarkBrowserContextLive(this);
431
430 #if defined(OS_ANDROID) 432 #if defined(OS_ANDROID)
431 // Make sure token service knows its running in tests. 433 // Make sure token service knows its running in tests.
432 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile(); 434 OAuth2TokenServiceDelegateAndroid::set_is_testing_profile();
433 #endif 435 #endif
434 436
435 // Normally this would happen during browser startup, but for tests 437 // Normally this would happen during browser startup, but for tests
436 // we need to trigger creation of Profile-related services. 438 // we need to trigger creation of Profile-related services.
437 ChromeBrowserMainExtraPartsProfiles:: 439 ChromeBrowserMainExtraPartsProfiles::
438 EnsureBrowserContextKeyedServiceFactoriesBuilt(); 440 EnsureBrowserContextKeyedServiceFactoriesBuilt();
439 441
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // Note: Owned by |original_profile|. 1093 // Note: Owned by |original_profile|.
1092 return new TestingProfile(path_, delegate_, 1094 return new TestingProfile(path_, delegate_,
1093 #if BUILDFLAG(ENABLE_EXTENSIONS) 1095 #if BUILDFLAG(ENABLE_EXTENSIONS)
1094 extension_policy_, 1096 extension_policy_,
1095 #endif 1097 #endif
1096 std::move(pref_service_), original_profile, 1098 std::move(pref_service_), original_profile,
1097 guest_session_, supervised_user_id_, 1099 guest_session_, supervised_user_id_,
1098 std::move(policy_service_), testing_factories_, 1100 std::move(policy_service_), testing_factories_,
1099 profile_name_); 1101 profile_name_);
1100 } 1102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698