| 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/i18n/case_conversion.h" | 12 #include "base/i18n/case_conversion.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "chrome/browser/autocomplete/in_memory_url_index.h" | |
| 20 #include "chrome/browser/autocomplete/url_index_private_data.h" | |
| 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 22 #include "chrome/browser/history/history_service_factory.h" | 20 #include "chrome/browser/history/history_service_factory.h" |
| 23 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/test/base/history_index_restore_observer.h" | 22 #include "chrome/test/base/history_index_restore_observer.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 26 #include "components/bookmarks/test/bookmark_test_helpers.h" | 24 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 27 #include "components/history/core/browser/history_backend.h" | 25 #include "components/history/core/browser/history_backend.h" |
| 28 #include "components/history/core/browser/history_database.h" | 26 #include "components/history/core/browser/history_database.h" |
| 29 #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.h" |
| 30 #include "components/omnibox/in_memory_url_index_types.h" | 29 #include "components/omnibox/in_memory_url_index_types.h" |
| 30 #include "components/omnibox/url_index_private_data.h" |
| 31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/test/test_browser_thread_bundle.h" | 32 #include "content/public/test/test_browser_thread_bundle.h" |
| 33 #include "sql/transaction.h" | 33 #include "sql/transaction.h" |
| 34 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
| 35 | 35 |
| 36 using base::ASCIIToUTF16; | 36 using base::ASCIIToUTF16; |
| 37 | 37 |
| 38 // The test version of the history url database table ('url') is contained in | 38 // The test version of the history url database table ('url') is contained in |
| 39 // a database file created from a text file('url_history_provider_test.db.txt'). | 39 // a database file created from a text file('url_history_provider_test.db.txt'). |
| 40 // The only difference between this table and a live 'urls' table from a | 40 // The only difference between this table and a live 'urls' table from a |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); | 1353 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); |
| 1354 std::vector<base::FilePath::StringType> actual_parts; | 1354 std::vector<base::FilePath::StringType> actual_parts; |
| 1355 full_file_path.GetComponents(&actual_parts); | 1355 full_file_path.GetComponents(&actual_parts); |
| 1356 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1356 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
| 1357 size_t count = expected_parts.size(); | 1357 size_t count = expected_parts.size(); |
| 1358 for (size_t i = 0; i < count; ++i) | 1358 for (size_t i = 0; i < count; ++i) |
| 1359 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1359 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
| 1360 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1360 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
| 1361 set_history_dir(base::FilePath()); | 1361 set_history_dir(base::FilePath()); |
| 1362 } | 1362 } |
| OLD | NEW |