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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <fstream> | 9 #include <fstream> |
10 | 10 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
15 #include "base/i18n/case_conversion.h" | 15 #include "base/i18n/case_conversion.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_split.h" | 20 #include "base/strings/string_split.h" |
21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
25 #include "chrome/browser/history/history_service_factory.h" | 25 #include "chrome/browser/history/history_service_factory.h" |
26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/test/base/history_index_restore_observer.h" | |
28 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
29 #include "components/bookmarks/test/bookmark_test_helpers.h" | 28 #include "components/bookmarks/test/bookmark_test_helpers.h" |
30 #include "components/history/core/browser/history_backend.h" | 29 #include "components/history/core/browser/history_backend.h" |
31 #include "components/history/core/browser/history_database.h" | 30 #include "components/history/core/browser/history_database.h" |
32 #include "components/history/core/browser/history_service.h" | 31 #include "components/history/core/browser/history_service.h" |
| 32 #include "components/omnibox/browser/history_index_restore_observer.h" |
33 #include "components/omnibox/browser/in_memory_url_index.h" | 33 #include "components/omnibox/browser/in_memory_url_index.h" |
34 #include "components/omnibox/browser/in_memory_url_index_types.h" | 34 #include "components/omnibox/browser/in_memory_url_index_types.h" |
35 #include "components/omnibox/browser/url_index_private_data.h" | 35 #include "components/omnibox/browser/url_index_private_data.h" |
36 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
37 #include "content/public/test/test_browser_thread_bundle.h" | 37 #include "content/public/test/test_browser_thread_bundle.h" |
38 #include "sql/transaction.h" | 38 #include "sql/transaction.h" |
39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
40 | 40 |
41 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
42 | 42 |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); | 1314 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); |
1315 std::vector<base::FilePath::StringType> actual_parts; | 1315 std::vector<base::FilePath::StringType> actual_parts; |
1316 full_file_path.GetComponents(&actual_parts); | 1316 full_file_path.GetComponents(&actual_parts); |
1317 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1317 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1318 size_t count = expected_parts.size(); | 1318 size_t count = expected_parts.size(); |
1319 for (size_t i = 0; i < count; ++i) | 1319 for (size_t i = 0; i < count; ++i) |
1320 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1320 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1321 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1321 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1322 set_history_dir(base::FilePath()); | 1322 set_history_dir(base::FilePath()); |
1323 } | 1323 } |
OLD | NEW |