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 "build/build_config.h" | 7 #include "build/build_config.h" |
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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL); | 452 WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL); |
453 return true; | 453 return true; |
454 } | 454 } |
455 | 455 |
456 void TestingProfile::DestroyHistoryService() { | 456 void TestingProfile::DestroyHistoryService() { |
457 HistoryService* history_service = | 457 HistoryService* history_service = |
458 HistoryServiceFactory::GetForProfileWithoutCreating(this); | 458 HistoryServiceFactory::GetForProfileWithoutCreating(this); |
459 if (!history_service) | 459 if (!history_service) |
460 return; | 460 return; |
461 | 461 |
462 history_service->NotifyRenderProcessHostDestruction(0); | 462 history_service->ClearCachedDataForContextID(0); |
463 history_service->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); | 463 history_service->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); |
464 history_service->Cleanup(); | 464 history_service->Cleanup(); |
465 HistoryServiceFactory::ShutdownForProfile(this); | 465 HistoryServiceFactory::ShutdownForProfile(this); |
466 | 466 |
467 // Wait for the backend class to terminate before deleting the files and | 467 // Wait for the backend class to terminate before deleting the files and |
468 // moving to the next test. Note: if this never terminates, somebody is | 468 // moving to the next test. Note: if this never terminates, somebody is |
469 // probably leaking a reference to the history backend, so it never calls | 469 // probably leaking a reference to the history backend, so it never calls |
470 // our destroy task. | 470 // our destroy task. |
471 base::MessageLoop::current()->Run(); | 471 base::MessageLoop::current()->Run(); |
472 | 472 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 path_, | 976 path_, |
977 delegate_, | 977 delegate_, |
978 extension_policy_, | 978 extension_policy_, |
979 pref_service_.Pass(), | 979 pref_service_.Pass(), |
980 incognito_, | 980 incognito_, |
981 guest_session_, | 981 guest_session_, |
982 managed_user_id_, | 982 managed_user_id_, |
983 policy_service_.Pass(), | 983 policy_service_.Pass(), |
984 testing_factories_)); | 984 testing_factories_)); |
985 } | 985 } |
OLD | NEW |