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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 AddRequest(request, this); | 108 AddRequest(request, this); |
109 return request->handle(); | 109 return request->handle(); |
110 } | 110 } |
111 }; | 111 }; |
112 | 112 |
113 class HistoryBackendTestBase : public testing::Test { | 113 class HistoryBackendTestBase : public testing::Test { |
114 public: | 114 public: |
115 typedef std::vector<std::pair<int, HistoryDetails*> > NotificationList; | 115 typedef std::vector<std::pair<int, HistoryDetails*> > NotificationList; |
116 | 116 |
117 HistoryBackendTestBase() | 117 HistoryBackendTestBase() |
118 : bookmark_model_(NULL), | 118 : bookmark_model_(NULL, false), |
119 loaded_(false), | 119 loaded_(false), |
120 ui_thread_(content::BrowserThread::UI, &message_loop_) { | 120 ui_thread_(content::BrowserThread::UI, &message_loop_) { |
121 } | 121 } |
122 | 122 |
123 virtual ~HistoryBackendTestBase() { | 123 virtual ~HistoryBackendTestBase() { |
124 STLDeleteValues(&broadcasted_notifications_); | 124 STLDeleteValues(&broadcasted_notifications_); |
125 } | 125 } |
126 | 126 |
127 protected: | 127 protected: |
128 int num_broadcasted_notifications() const { | 128 int num_broadcasted_notifications() const { |
(...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 // Verify that the second term is no longer returned as result, and also check | 3384 // Verify that the second term is no longer returned as result, and also check |
3385 // at the low level that it is gone for good. The term corresponding to the | 3385 // at the low level that it is gone for good. The term corresponding to the |
3386 // first URLRow should not be affected. | 3386 // first URLRow should not be affected. |
3387 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); | 3387 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); |
3388 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); | 3388 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); |
3389 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); | 3389 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); |
3390 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); | 3390 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); |
3391 } | 3391 } |
3392 | 3392 |
3393 } // namespace history | 3393 } // namespace history |
OLD | NEW |