| 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 "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 Loading... |
| 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()->GetString(prefs::kAcceptLanguages), |
| 572 history::HistoryDatabaseParamsForPath(GetPath()))) { |
| 572 HistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr); | 573 HistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr); |
| 573 return false; | 574 return false; |
| 574 } | 575 } |
| 575 // Disable WebHistoryService by default, since it makes network requests. | 576 // Disable WebHistoryService by default, since it makes network requests. |
| 576 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr); | 577 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr); |
| 577 return true; | 578 return true; |
| 578 } | 579 } |
| 579 | 580 |
| 580 void TestingProfile::DestroyHistoryService() { | 581 void TestingProfile::DestroyHistoryService() { |
| 581 HistoryService* history_service = | 582 HistoryService* history_service = |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 #if defined(ENABLE_EXTENSIONS) | 1084 #if defined(ENABLE_EXTENSIONS) |
| 1084 extension_policy_, | 1085 extension_policy_, |
| 1085 #endif | 1086 #endif |
| 1086 pref_service_.Pass(), | 1087 pref_service_.Pass(), |
| 1087 original_profile, | 1088 original_profile, |
| 1088 guest_session_, | 1089 guest_session_, |
| 1089 supervised_user_id_, | 1090 supervised_user_id_, |
| 1090 policy_service_.Pass(), | 1091 policy_service_.Pass(), |
| 1091 testing_factories_); | 1092 testing_factories_); |
| 1092 } | 1093 } |
| OLD | NEW |