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/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/autocomplete/autocomplete.h" | 16 #include "chrome/browser/autocomplete/autocomplete.h" |
17 #include "chrome/browser/history/history.h" | 17 #include "chrome/browser/history/history.h" |
18 #include "chrome/browser/history/history_backend.h" | 18 #include "chrome/browser/history/history_backend.h" |
19 #include "chrome/browser/history/history_database.h" | 19 #include "chrome/browser/history/history_database.h" |
20 #include "chrome/browser/history/history_notifications.h" | 20 #include "chrome/browser/history/history_notifications.h" |
21 #include "chrome/browser/history/in_memory_url_index_types.h" | 21 #include "chrome/browser/history/in_memory_url_index_types.h" |
22 #include "chrome/browser/history/in_memory_url_index.h" | 22 #include "chrome/browser/history/in_memory_url_index.h" |
23 #include "chrome/browser/history/url_index_private_data.h" | 23 #include "chrome/browser/history/url_index_private_data.h" |
24 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
26 #include "content/public/browser/notification_details.h" | 26 #include "content/public/browser/notification_details.h" |
27 #include "content/public/browser/notification_source.h" | 27 #include "content/public/browser/notification_source.h" |
28 #include "chrome/test/base/testing_profile.h" | 28 #include "chrome/test/base/testing_profile.h" |
29 #include "content/test/test_browser_thread.h" | 29 #include "content/public/test/test_browser_thread.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 content::BrowserThread; | 33 using content::BrowserThread; |
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 |
39 // number specifying the number of days relative to 'today' to which the | 39 // number specifying the number of days relative to 'today' to which the |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 full_file_path.GetComponents(&actual_parts); | 1050 full_file_path.GetComponents(&actual_parts); |
1051 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1051 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1052 size_t count = expected_parts.size(); | 1052 size_t count = expected_parts.size(); |
1053 for (size_t i = 0; i < count; ++i) | 1053 for (size_t i = 0; i < count; ++i) |
1054 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1054 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1055 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1055 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1056 set_history_dir(FilePath()); | 1056 set_history_dir(FilePath()); |
1057 } | 1057 } |
1058 | 1058 |
1059 } // namespace history | 1059 } // namespace history |
OLD | NEW |