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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 WebDataServiceFactory::GetInstance()->SetTestingFactory( | 641 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
642 this, BuildWebDataService); | 642 this, BuildWebDataService); |
643 } | 643 } |
644 | 644 |
645 void TestingProfile::BlockUntilHistoryIndexIsRefreshed() { | 645 void TestingProfile::BlockUntilHistoryIndexIsRefreshed() { |
646 // Only get the history service if it actually exists since the caller of the | 646 // Only get the history service if it actually exists since the caller of the |
647 // test should explicitly call CreateHistoryService to build it. | 647 // test should explicitly call CreateHistoryService to build it. |
648 HistoryService* history_service = | 648 HistoryService* history_service = |
649 HistoryServiceFactory::GetForProfileWithoutCreating(this); | 649 HistoryServiceFactory::GetForProfileWithoutCreating(this); |
650 DCHECK(history_service); | 650 DCHECK(history_service); |
651 history::InMemoryURLIndex* index = history_service->InMemoryIndex(); | 651 InMemoryURLIndex* index = history_service->InMemoryIndex(); |
652 if (!index || index->restored()) | 652 if (!index || index->restored()) |
653 return; | 653 return; |
654 base::RunLoop run_loop; | 654 base::RunLoop run_loop; |
655 HistoryIndexRestoreObserver observer( | 655 HistoryIndexRestoreObserver observer( |
656 content::GetQuitTaskForRunLoop(&run_loop)); | 656 content::GetQuitTaskForRunLoop(&run_loop)); |
657 index->set_restore_cache_observer(&observer); | 657 index->set_restore_cache_observer(&observer); |
658 run_loop.Run(); | 658 run_loop.Run(); |
659 index->set_restore_cache_observer(NULL); | 659 index->set_restore_cache_observer(NULL); |
660 DCHECK(index->restored()); | 660 DCHECK(index->restored()); |
661 } | 661 } |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 #if defined(ENABLE_EXTENSIONS) | 1101 #if defined(ENABLE_EXTENSIONS) |
1102 extension_policy_, | 1102 extension_policy_, |
1103 #endif | 1103 #endif |
1104 pref_service_.Pass(), | 1104 pref_service_.Pass(), |
1105 original_profile, | 1105 original_profile, |
1106 guest_session_, | 1106 guest_session_, |
1107 supervised_user_id_, | 1107 supervised_user_id_, |
1108 policy_service_.Pass(), | 1108 policy_service_.Pass(), |
1109 testing_factories_); | 1109 testing_factories_); |
1110 } | 1110 } |
OLD | NEW |