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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "chrome/browser/history/android/android_history_types.h" | 9 #include "chrome/browser/history/android/android_history_types.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Setup the testing profile, so the bookmark_model_sql_handler could | 46 // Setup the testing profile, so the bookmark_model_sql_handler could |
47 // get the bookmark model from it. | 47 // get the bookmark model from it. |
48 ASSERT_TRUE(profile_manager_.SetUp()); | 48 ASSERT_TRUE(profile_manager_.SetUp()); |
49 // It seems that the name has to be chrome::kInitialProfile, so it | 49 // It seems that the name has to be chrome::kInitialProfile, so it |
50 // could be found by ProfileManager::GetLastUsedProfile(). | 50 // could be found by ProfileManager::GetLastUsedProfile(). |
51 testing_profile_ = profile_manager_.CreateTestingProfile( | 51 testing_profile_ = profile_manager_.CreateTestingProfile( |
52 chrome::kInitialProfile); | 52 chrome::kInitialProfile); |
53 | 53 |
54 testing_profile_->CreateBookmarkModel(true); | 54 testing_profile_->CreateBookmarkModel(true); |
55 ui_test_utils::WaitForBookmarkModelToLoad(testing_profile_); | 55 ui_test_utils::WaitForBookmarkModelToLoad(testing_profile_); |
56 ASSERT_TRUE(testing_profile_->CreateHistoryService(true, false)); | 56 testing_profile_->CreateHistoryService(true, false); |
57 service_.reset(new AndroidHistoryProviderService(testing_profile_)); | 57 service_.reset(new AndroidHistoryProviderService(testing_profile_)); |
58 } | 58 } |
59 | 59 |
60 virtual void TearDown() OVERRIDE { | 60 virtual void TearDown() OVERRIDE { |
61 testing_profile_->DestroyHistoryService(); | 61 testing_profile_->DestroyHistoryService(); |
62 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); | 62 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); |
63 testing_profile_=NULL; | 63 testing_profile_=NULL; |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 // Delete the row. | 254 // Delete the row. |
255 service_->DeleteSearchTerms(std::string(), std::vector<string16>(), | 255 service_->DeleteSearchTerms(std::string(), std::vector<string16>(), |
256 &cancelable_consumer_, Bind(&CallbackHelper::OnDeleted, callback.get())); | 256 &cancelable_consumer_, Bind(&CallbackHelper::OnDeleted, callback.get())); |
257 base::MessageLoop::current()->Run(); | 257 base::MessageLoop::current()->Run(); |
258 EXPECT_TRUE(callback->success()); | 258 EXPECT_TRUE(callback->success()); |
259 EXPECT_EQ(1, callback->count()); | 259 EXPECT_EQ(1, callback->count()); |
260 } | 260 } |
261 | 261 |
262 } // namespace | 262 } // namespace |
OLD | NEW |