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

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

Issue 671593002: Do not delay most visited results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed slow mv return condition and added unit tests Created 6 years, 2 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 "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/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 base::MessageLoop::QuitClosure()); 524 base::MessageLoop::QuitClosure());
525 base::MessageLoop::current()->Run(); 525 base::MessageLoop::current()->Run();
526 } 526 }
527 527
528 void TestingProfile::CreateTopSites() { 528 void TestingProfile::CreateTopSites() {
529 DestroyTopSites(); 529 DestroyTopSites();
530 top_sites_ = history::TopSites::Create( 530 top_sites_ = history::TopSites::Create(
531 this, GetPath().Append(chrome::kTopSitesFilename)); 531 this, GetPath().Append(chrome::kTopSitesFilename));
532 } 532 }
533 533
534 void TestingProfile::SetTopSites(history::TopSites* top_sites) {
535 DestroyTopSites();
536 top_sites_ = top_sites;
537 }
538
534 void TestingProfile::DestroyTopSites() { 539 void TestingProfile::DestroyTopSites() {
535 if (top_sites_.get()) { 540 if (top_sites_.get()) {
536 top_sites_->Shutdown(); 541 top_sites_->Shutdown();
537 top_sites_ = NULL; 542 top_sites_ = NULL;
538 // TopSitesImpl::Shutdown schedules some tasks (from TopSitesBackend) that 543 // TopSitesImpl::Shutdown schedules some tasks (from TopSitesBackend) that
539 // need to be run to properly shutdown. Run all pending tasks now. This is 544 // need to be run to properly shutdown. Run all pending tasks now. This is
540 // normally handled by browser_process shutdown. 545 // normally handled by browser_process shutdown.
541 if (base::MessageLoop::current()) 546 if (base::MessageLoop::current())
542 base::MessageLoop::current()->RunUntilIdle(); 547 base::MessageLoop::current()->RunUntilIdle();
543 } 548 }
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 #if defined(ENABLE_EXTENSIONS) 1034 #if defined(ENABLE_EXTENSIONS)
1030 extension_policy_, 1035 extension_policy_,
1031 #endif 1036 #endif
1032 pref_service_.Pass(), 1037 pref_service_.Pass(),
1033 original_profile, 1038 original_profile,
1034 guest_session_, 1039 guest_session_,
1035 supervised_user_id_, 1040 supervised_user_id_,
1036 policy_service_.Pass(), 1041 policy_service_.Pass(),
1037 testing_factories_); 1042 testing_factories_);
1038 } 1043 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698