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 <algorithm> | 5 #include <algorithm> |
6 #include <fstream> | 6 #include <fstream> |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 EXPECT_TRUE(std::equal(expected_word_starts.title_word_starts_.begin(), | 377 EXPECT_TRUE(std::equal(expected_word_starts.title_word_starts_.begin(), |
378 expected_word_starts.title_word_starts_.end(), | 378 expected_word_starts.title_word_starts_.end(), |
379 actual_word_starts.title_word_starts_.begin())); | 379 actual_word_starts.title_word_starts_.begin())); |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 //------------------------------------------------------------------------------ | 383 //------------------------------------------------------------------------------ |
384 | 384 |
385 class LimitedInMemoryURLIndexTest : public InMemoryURLIndexTest { | 385 class LimitedInMemoryURLIndexTest : public InMemoryURLIndexTest { |
386 protected: | 386 protected: |
387 FilePath::StringType TestDBName() const; | 387 virtual FilePath::StringType TestDBName() const OVERRIDE; |
388 }; | 388 }; |
389 | 389 |
390 FilePath::StringType LimitedInMemoryURLIndexTest::TestDBName() const { | 390 FilePath::StringType LimitedInMemoryURLIndexTest::TestDBName() const { |
391 return FILE_PATH_LITERAL("url_history_provider_test_limited.db.txt"); | 391 return FILE_PATH_LITERAL("url_history_provider_test_limited.db.txt"); |
392 } | 392 } |
393 | 393 |
394 TEST_F(LimitedInMemoryURLIndexTest, Initialization) { | 394 TEST_F(LimitedInMemoryURLIndexTest, Initialization) { |
395 // Verify that the database contains the expected number of items, which | 395 // Verify that the database contains the expected number of items, which |
396 // is the pre-filtered count, i.e. all of the items. | 396 // is the pre-filtered count, i.e. all of the items. |
397 sql::Statement statement(GetDB().GetUniqueStatement("SELECT * FROM urls;")); | 397 sql::Statement statement(GetDB().GetUniqueStatement("SELECT * FROM urls;")); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 full_file_path.GetComponents(&actual_parts); | 948 full_file_path.GetComponents(&actual_parts); |
949 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 949 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
950 size_t count = expected_parts.size(); | 950 size_t count = expected_parts.size(); |
951 for (size_t i = 0; i < count; ++i) | 951 for (size_t i = 0; i < count; ++i) |
952 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 952 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
953 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 953 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
954 set_history_dir(FilePath()); | 954 set_history_dir(FilePath()); |
955 } | 955 } |
956 | 956 |
957 } // namespace history | 957 } // namespace history |
OLD | NEW |