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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 service_.reset(new AndroidHistoryProviderService(testing_profile_)); | 60 service_.reset(new AndroidHistoryProviderService(testing_profile_)); |
61 } | 61 } |
62 | 62 |
63 void TearDown() override { | 63 void TearDown() override { |
64 testing_profile_->DestroyHistoryService(); | 64 testing_profile_->DestroyHistoryService(); |
65 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); | 65 profile_manager_.DeleteTestingProfile(chrome::kInitialProfile); |
66 testing_profile_ = nullptr; | 66 testing_profile_ = nullptr; |
67 } | 67 } |
68 | 68 |
69 protected: | 69 protected: |
| 70 content::TestBrowserThreadBundle test_browser_thread_bundle_; |
70 TestingProfileManager profile_manager_; | 71 TestingProfileManager profile_manager_; |
71 content::TestBrowserThreadBundle test_browser_thread_bundle_; | |
72 std::unique_ptr<AndroidHistoryProviderService> service_; | 72 std::unique_ptr<AndroidHistoryProviderService> service_; |
73 base::CancelableTaskTracker cancelable_tracker_; | 73 base::CancelableTaskTracker cancelable_tracker_; |
74 TestingProfile* testing_profile_; | 74 TestingProfile* testing_profile_; |
75 | 75 |
76 private: | 76 private: |
77 DISALLOW_COPY_AND_ASSIGN(AndroidHistoryProviderServiceTest); | 77 DISALLOW_COPY_AND_ASSIGN(AndroidHistoryProviderServiceTest); |
78 }; | 78 }; |
79 | 79 |
80 class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { | 80 class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { |
81 public: | 81 public: |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 service_->DeleteSearchTerms(std::string(), | 283 service_->DeleteSearchTerms(std::string(), |
284 std::vector<base::string16>(), | 284 std::vector<base::string16>(), |
285 Bind(&CallbackHelper::OnDeleted, callback.get()), | 285 Bind(&CallbackHelper::OnDeleted, callback.get()), |
286 &cancelable_tracker_); | 286 &cancelable_tracker_); |
287 RunMessageLoop(callback.get()); | 287 RunMessageLoop(callback.get()); |
288 EXPECT_TRUE(callback->success()); | 288 EXPECT_TRUE(callback->success()); |
289 EXPECT_EQ(1, callback->count()); | 289 EXPECT_EQ(1, callback->count()); |
290 } | 290 } |
291 | 291 |
292 } // namespace | 292 } // namespace |
OLD | NEW |