OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 protected: | 159 protected: |
160 virtual void SetUp() { | 160 virtual void SetUp() { |
161 } | 161 } |
162 | 162 |
163 virtual void TearDown() { | 163 virtual void TearDown() { |
164 file_util::Delete(dir_, true); | 164 file_util::Delete(dir_, true); |
165 } | 165 } |
166 | 166 |
167 MessageLoop message_loop_; | 167 base::MessageLoop message_loop_; |
168 | 168 |
169 // Directory containing the databases. | 169 // Directory containing the databases. |
170 base::FilePath dir_; | 170 base::FilePath dir_; |
171 }; | 171 }; |
172 | 172 |
173 // Tests basic querying. | 173 // Tests basic querying. |
174 TEST_F(TextDatabaseManagerTest, InsertQuery) { | 174 TEST_F(TextDatabaseManagerTest, InsertQuery) { |
175 ASSERT_TRUE(Init()); | 175 ASSERT_TRUE(Init()); |
176 InMemDB visit_db; | 176 InMemDB visit_db; |
177 TextDatabaseManager manager(dir_, &visit_db, &visit_db); | 177 TextDatabaseManager manager(dir_, &visit_db, &visit_db); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 times.push_back(Time::FromInternalValue(5)); | 589 times.push_back(Time::FromInternalValue(5)); |
590 times.push_back(Time::FromInternalValue(5)); | 590 times.push_back(Time::FromInternalValue(5)); |
591 times.push_back(Time::FromInternalValue(3)); | 591 times.push_back(Time::FromInternalValue(3)); |
592 times.push_back(Time::FromInternalValue(1)); | 592 times.push_back(Time::FromInternalValue(1)); |
593 manager.DeleteFromUncommittedForTimes(times); | 593 manager.DeleteFromUncommittedForTimes(times); |
594 | 594 |
595 EXPECT_EQ(3u, manager.GetUncommittedEntryCountForTest()); | 595 EXPECT_EQ(3u, manager.GetUncommittedEntryCountForTest()); |
596 } | 596 } |
597 | 597 |
598 } // namespace history | 598 } // namespace history |
OLD | NEW |