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 "components/history/core/browser/expire_history_backend.h" | 5 #include "components/history/core/browser/expire_history_backend.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
20 #include "base/prefs/pref_registry_simple.h" | |
21 #include "base/prefs/testing_pref_service.h" | |
22 #include "base/scoped_observer.h" | 20 #include "base/scoped_observer.h" |
23 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
24 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
25 #include "components/history/core/browser/history_backend_client.h" | 23 #include "components/history/core/browser/history_backend_client.h" |
26 #include "components/history/core/browser/history_backend_notifier.h" | 24 #include "components/history/core/browser/history_backend_notifier.h" |
27 #include "components/history/core/browser/history_constants.h" | 25 #include "components/history/core/browser/history_constants.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/thumbnail_database.h" | 27 #include "components/history/core/browser/thumbnail_database.h" |
30 #include "components/history/core/browser/top_sites.h" | 28 #include "components/history/core/browser/top_sites.h" |
31 #include "components/history/core/browser/top_sites_impl.h" | 29 #include "components/history/core/browser/top_sites_impl.h" |
32 #include "components/history/core/browser/top_sites_observer.h" | 30 #include "components/history/core/browser/top_sites_observer.h" |
33 #include "components/history/core/common/thumbnail_score.h" | 31 #include "components/history/core/common/thumbnail_score.h" |
34 #include "components/history/core/test/history_client_fake_bookmarks.h" | 32 #include "components/history/core/test/history_client_fake_bookmarks.h" |
35 #include "components/history/core/test/test_history_database.h" | 33 #include "components/history/core/test/test_history_database.h" |
36 #include "components/history/core/test/thumbnail.h" | 34 #include "components/history/core/test/thumbnail.h" |
37 #include "components/history/core/test/wait_top_sites_loaded_observer.h" | 35 #include "components/history/core/test/wait_top_sites_loaded_observer.h" |
| 36 #include "components/prefs/pref_registry_simple.h" |
| 37 #include "components/prefs/testing_pref_service.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
39 | 39 |
40 // The test must be in the history namespace for the gtest forward declarations | 40 // The test must be in the history namespace for the gtest forward declarations |
41 // to work. It also eliminates a bunch of ugly "history::". | 41 // to work. It also eliminates a bunch of ugly "history::". |
42 namespace history { | 42 namespace history { |
43 | 43 |
44 namespace { | 44 namespace { |
45 // Returns whether |url| can be added to history. | 45 // Returns whether |url| can be added to history. |
46 bool MockCanAddURLToHistory(const GURL& url) { | 46 bool MockCanAddURLToHistory(const GURL& url) { |
47 return url.is_valid(); | 47 return url.is_valid(); |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); | 888 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); |
889 EXPECT_EQ(1U, visits.size()); | 889 EXPECT_EQ(1U, visits.size()); |
890 } | 890 } |
891 | 891 |
892 // TODO(brettw) add some visits with no URL to make sure everything is updated | 892 // TODO(brettw) add some visits with no URL to make sure everything is updated |
893 // properly. Have the visits also refer to nonexistent FTS rows. | 893 // properly. Have the visits also refer to nonexistent FTS rows. |
894 // | 894 // |
895 // Maybe also refer to invalid favicons. | 895 // Maybe also refer to invalid favicons. |
896 | 896 |
897 } // namespace history | 897 } // namespace history |
OLD | NEW |