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

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

Issue 870143004: HistoryService::Init() receives the list of languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-history-service
Patch Set: Created 5 years, 10 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 base::FilePath path = GetPath(); 561 base::FilePath path = GetPath();
562 path = path.Append(history::kHistoryFilename); 562 path = path.Append(history::kHistoryFilename);
563 if (!base::DeleteFile(path, false) || base::PathExists(path)) 563 if (!base::DeleteFile(path, false) || base::PathExists(path))
564 return false; 564 return false;
565 } 565 }
566 // This will create and init the history service. 566 // This will create and init the history service.
567 HistoryService* history_service = static_cast<HistoryService*>( 567 HistoryService* history_service = static_cast<HistoryService*>(
568 HistoryServiceFactory::GetInstance()->SetTestingFactoryAndUse( 568 HistoryServiceFactory::GetInstance()->SetTestingFactoryAndUse(
569 this, BuildHistoryService)); 569 this, BuildHistoryService));
570 if (!history_service->Init( 570 if (!history_service->Init(
571 no_db, history::HistoryDatabaseParamsForPath(this->GetPath()))) { 571 no_db, GetPrefs(),
572 history::HistoryDatabaseParamsForPath(GetPath()))) {
572 HistoryServiceFactory::GetInstance()->SetTestingFactoryAndUse(this, NULL); 573 HistoryServiceFactory::GetInstance()->SetTestingFactoryAndUse(this, NULL);
573 } 574 }
574 // Disable WebHistoryService by default, since it makes network requests. 575 // Disable WebHistoryService by default, since it makes network requests.
575 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL); 576 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL);
576 return true; 577 return true;
577 } 578 }
578 579
579 void TestingProfile::DestroyHistoryService() { 580 void TestingProfile::DestroyHistoryService() {
580 // TODO(sdefresne): remove this once ChromeHistoryClient is no longer an 581 // TODO(sdefresne): remove this once ChromeHistoryClient is no longer an
581 // HistoryServiceObserver, http://crbug.com/373326 582 // HistoryServiceObserver, http://crbug.com/373326
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 #if defined(ENABLE_EXTENSIONS) 1090 #if defined(ENABLE_EXTENSIONS)
1090 extension_policy_, 1091 extension_policy_,
1091 #endif 1092 #endif
1092 pref_service_.Pass(), 1093 pref_service_.Pass(),
1093 original_profile, 1094 original_profile,
1094 guest_session_, 1095 guest_session_,
1095 supervised_user_id_, 1096 supervised_user_id_,
1096 policy_service_.Pass(), 1097 policy_service_.Pass(),
1097 testing_factories_); 1098 testing_factories_);
1098 } 1099 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698