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 2564943002: Reland "Add thread checking to RunLoop, deprecate MessageLoopRunner. (patchset #4 id:20002 of https… (Closed)
Patch Set: Created 4 years 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 // Only get the history service if it actually exists since the caller of the 644 // Only get the history service if it actually exists since the caller of the
645 // test should explicitly call CreateHistoryService to build it. 645 // test should explicitly call CreateHistoryService to build it.
646 history::HistoryService* history_service = 646 history::HistoryService* history_service =
647 HistoryServiceFactory::GetForProfileWithoutCreating(this); 647 HistoryServiceFactory::GetForProfileWithoutCreating(this);
648 DCHECK(history_service); 648 DCHECK(history_service);
649 InMemoryURLIndex* index = InMemoryURLIndexFactory::GetForProfile(this); 649 InMemoryURLIndex* index = InMemoryURLIndexFactory::GetForProfile(this);
650 if (!index || index->restored()) 650 if (!index || index->restored())
651 return; 651 return;
652 base::RunLoop run_loop; 652 base::RunLoop run_loop;
653 HistoryIndexRestoreObserver observer( 653 HistoryIndexRestoreObserver observer(
654 content::GetQuitTaskForRunLoop(&run_loop)); 654 content::GetDeferredQuitTaskForRunLoop(&run_loop));
655 index->set_restore_cache_observer(&observer); 655 index->set_restore_cache_observer(&observer);
656 run_loop.Run(); 656 run_loop.Run();
657 index->set_restore_cache_observer(NULL); 657 index->set_restore_cache_observer(NULL);
658 DCHECK(index->restored()); 658 DCHECK(index->restored());
659 } 659 }
660 660
661 void TestingProfile::SetGuestSession(bool guest) { 661 void TestingProfile::SetGuestSession(bool guest) {
662 guest_session_ = guest; 662 guest_session_ = guest;
663 } 663 }
664 664
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // Note: Owned by |original_profile|. 1091 // Note: Owned by |original_profile|.
1092 return new TestingProfile(path_, delegate_, 1092 return new TestingProfile(path_, delegate_,
1093 #if BUILDFLAG(ENABLE_EXTENSIONS) 1093 #if BUILDFLAG(ENABLE_EXTENSIONS)
1094 extension_policy_, 1094 extension_policy_,
1095 #endif 1095 #endif
1096 std::move(pref_service_), original_profile, 1096 std::move(pref_service_), original_profile,
1097 guest_session_, supervised_user_id_, 1097 guest_session_, supervised_user_id_,
1098 std::move(policy_service_), testing_factories_, 1098 std::move(policy_service_), testing_factories_,
1099 profile_name_); 1099 profile_name_);
1100 } 1100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698