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/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 TEST_F(HistoryBackendTest, RemoveNotification) { | 3035 TEST_F(HistoryBackendTest, RemoveNotification) { |
3036 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 3036 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
3037 | 3037 |
3038 // Add a URL. | 3038 // Add a URL. |
3039 GURL url("http://www.google.com"); | 3039 GURL url("http://www.google.com"); |
3040 HistoryClientMock history_client; | 3040 HistoryClientMock history_client; |
3041 history_client.AddBookmark(url); | 3041 history_client.AddBookmark(url); |
3042 scoped_ptr<HistoryService> service( | 3042 scoped_ptr<HistoryService> service( |
3043 new HistoryService(&history_client, profile.get())); | 3043 new HistoryService(&history_client, profile.get())); |
3044 EXPECT_TRUE( | 3044 EXPECT_TRUE( |
3045 service->Init(TestHistoryDatabaseParamsForPath(profile->GetPath()))); | 3045 service->Init(profile->GetPrefs(), |
| 3046 TestHistoryDatabaseParamsForPath(profile->GetPath()))); |
3046 | 3047 |
3047 service->AddPage( | 3048 service->AddPage( |
3048 url, base::Time::Now(), NULL, 1, GURL(), RedirectList(), | 3049 url, base::Time::Now(), NULL, 1, GURL(), RedirectList(), |
3049 ui::PAGE_TRANSITION_TYPED, SOURCE_BROWSED, false); | 3050 ui::PAGE_TRANSITION_TYPED, SOURCE_BROWSED, false); |
3050 | 3051 |
3051 // This won't actually delete the URL, rather it'll empty out the visits. | 3052 // This won't actually delete the URL, rather it'll empty out the visits. |
3052 // This triggers blocking on the BookmarkModel. | 3053 // This triggers blocking on the BookmarkModel. |
3053 EXPECT_CALL(history_client, BlockUntilBookmarksLoaded()); | 3054 EXPECT_CALL(history_client, BlockUntilBookmarksLoaded()); |
3054 service->DeleteURL(url); | 3055 service->DeleteURL(url); |
3055 } | 3056 } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3286 // Verify that the second term is no longer returned as result, and also check | 3287 // Verify that the second term is no longer returned as result, and also check |
3287 // at the low level that it is gone for good. The term corresponding to the | 3288 // at the low level that it is gone for good. The term corresponding to the |
3288 // first URLRow should not be affected. | 3289 // first URLRow should not be affected. |
3289 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); | 3290 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); |
3290 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); | 3291 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); |
3291 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); | 3292 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); |
3292 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); | 3293 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); |
3293 } | 3294 } |
3294 | 3295 |
3295 } // namespace history | 3296 } // namespace history |
OLD | NEW |