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/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "chrome/browser/autocomplete/in_memory_url_index.h" | 17 #include "chrome/browser/autocomplete/in_memory_url_index.h" |
18 #include "chrome/browser/autocomplete/in_memory_url_index_types.h" | |
19 #include "chrome/browser/autocomplete/url_index_private_data.h" | 18 #include "chrome/browser/autocomplete/url_index_private_data.h" |
20 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
21 #include "chrome/browser/history/history_service_factory.h" | 20 #include "chrome/browser/history/history_service_factory.h" |
22 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/test/base/history_index_restore_observer.h" | 22 #include "chrome/test/base/history_index_restore_observer.h" |
24 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
25 #include "components/bookmarks/test/bookmark_test_helpers.h" | 24 #include "components/bookmarks/test/bookmark_test_helpers.h" |
26 #include "components/history/core/browser/history_backend.h" | 25 #include "components/history/core/browser/history_backend.h" |
27 #include "components/history/core/browser/history_database.h" | 26 #include "components/history/core/browser/history_database.h" |
28 #include "components/history/core/browser/history_service.h" | 27 #include "components/history/core/browser/history_service.h" |
| 28 #include "components/omnibox/in_memory_url_index_types.h" |
29 #include "content/public/test/test_browser_thread_bundle.h" | 29 #include "content/public/test/test_browser_thread_bundle.h" |
30 #include "sql/transaction.h" | 30 #include "sql/transaction.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 using base::ASCIIToUTF16; | 33 using base::ASCIIToUTF16; |
34 | 34 |
35 // The test version of the history url database table ('url') is contained in | 35 // The test version of the history url database table ('url') is contained in |
36 // a database file created from a text file('url_history_provider_test.db.txt'). | 36 // a database file created from a text file('url_history_provider_test.db.txt'). |
37 // The only difference between this table and a live 'urls' table from a | 37 // The only difference between this table and a live 'urls' table from a |
38 // profile is that the last_visit_time column in the test table contains a | 38 // profile is that the last_visit_time column in the test table contains a |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); | 1242 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); |
1243 std::vector<base::FilePath::StringType> actual_parts; | 1243 std::vector<base::FilePath::StringType> actual_parts; |
1244 full_file_path.GetComponents(&actual_parts); | 1244 full_file_path.GetComponents(&actual_parts); |
1245 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1245 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1246 size_t count = expected_parts.size(); | 1246 size_t count = expected_parts.size(); |
1247 for (size_t i = 0; i < count; ++i) | 1247 for (size_t i = 0; i < count; ++i) |
1248 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1248 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1249 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1249 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1250 set_history_dir(base::FilePath()); | 1250 set_history_dir(base::FilePath()); |
1251 } | 1251 } |
OLD | NEW |