Chromium Code Reviews| 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/browser/history/android/android_history_provider_service.h" | 5 #include "chrome/browser/history/android/android_history_provider_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 // Setup the testing profile, so the bookmark_model_sql_handler could | 51 // Setup the testing profile, so the bookmark_model_sql_handler could |
| 52 // get the bookmark model from it. | 52 // get the bookmark model from it. |
| 53 ASSERT_TRUE(profile_manager_.SetUp()); | 53 ASSERT_TRUE(profile_manager_.SetUp()); |
| 54 // It seems that the name has to be chrome::kInitialProfile, so it | 54 // It seems that the name has to be chrome::kInitialProfile, so it |
| 55 // could be found by ProfileManager::GetLastUsedProfile(). | 55 // could be found by ProfileManager::GetLastUsedProfile(). |
| 56 testing_profile_ = profile_manager_.CreateTestingProfile( | 56 testing_profile_ = profile_manager_.CreateTestingProfile( |
| 57 chrome::kInitialProfile); | 57 chrome::kInitialProfile); |
| 58 | 58 |
| 59 testing_profile_->CreateBookmarkModel(true); | 59 testing_profile_->CreateBookmarkModel(true); |
| 60 bookmarks::test::WaitForBookmarkModelToLoad( | 60 bookmarks::test::WaitForBookmarkModelToLoad( |
| 61 BookmarkModelFactory::GetForProfile(testing_profile_)); | 61 BookmarkModelFactory::GetForBrowserContext(testing_profile_)); |
| 62 ASSERT_TRUE(testing_profile_->CreateHistoryService(true, false)); | 62 ASSERT_TRUE(testing_profile_->CreateHistoryService(true, false)); |
| 63 service_.reset(new AndroidHistoryProviderService(testing_profile_)); | 63 service_.reset(new AndroidHistoryProviderService(testing_profile_)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void TearDown() override { | 66 void TearDown() override { |
| 67 testing_profile_->DestroyHistoryService(); | 67 testing_profile_->DestroyHistoryService(); |
| 68 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); | 68 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); |
| 69 testing_profile_=NULL; | 69 testing_profile_ = NULL; |
|
sky
2016/08/04 20:09:13
If you're going to change this you may as well upd
Philipp Keck
2016/08/05 07:57:17
Done.
| |
| 70 } | 70 } |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 TestingProfileManager profile_manager_; | 73 TestingProfileManager profile_manager_; |
| 74 base::MessageLoop message_loop_; | 74 base::MessageLoop message_loop_; |
| 75 content::TestBrowserThread ui_thread_; | 75 content::TestBrowserThread ui_thread_; |
| 76 content::TestBrowserThread file_thread_; | 76 content::TestBrowserThread file_thread_; |
| 77 std::unique_ptr<AndroidHistoryProviderService> service_; | 77 std::unique_ptr<AndroidHistoryProviderService> service_; |
| 78 base::CancelableTaskTracker cancelable_tracker_; | 78 base::CancelableTaskTracker cancelable_tracker_; |
| 79 TestingProfile* testing_profile_; | 79 TestingProfile* testing_profile_; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 service_->DeleteSearchTerms(std::string(), | 279 service_->DeleteSearchTerms(std::string(), |
| 280 std::vector<base::string16>(), | 280 std::vector<base::string16>(), |
| 281 Bind(&CallbackHelper::OnDeleted, callback.get()), | 281 Bind(&CallbackHelper::OnDeleted, callback.get()), |
| 282 &cancelable_tracker_); | 282 &cancelable_tracker_); |
| 283 base::MessageLoop::current()->Run(); | 283 base::MessageLoop::current()->Run(); |
| 284 EXPECT_TRUE(callback->success()); | 284 EXPECT_TRUE(callback->success()); |
| 285 EXPECT_EQ(1, callback->count()); | 285 EXPECT_EQ(1, callback->count()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace | 288 } // namespace |
| OLD | NEW |