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 <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "chrome/browser/history/expire_history_backend.h" | 18 #include "chrome/browser/history/expire_history_backend.h" |
19 #include "chrome/browser/history/history_database.h" | 19 #include "chrome/browser/history/history_database.h" |
20 #include "chrome/browser/history/thumbnail_database.h" | 20 #include "chrome/browser/history/thumbnail_database.h" |
21 #include "chrome/browser/history/top_sites.h" | 21 #include "chrome/browser/history/top_sites_provider.h" |
22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
23 #include "chrome/tools/profiles/thumbnail-inl.h" | 23 #include "chrome/tools/profiles/thumbnail-inl.h" |
24 #include "components/history/core/browser/history_backend_notifier.h" | 24 #include "components/history/core/browser/history_backend_notifier.h" |
25 #include "components/history/core/common/thumbnail_score.h" | 25 #include "components/history/core/common/thumbnail_score.h" |
26 #include "components/history/core/test/history_client_fake_bookmarks.h" | 26 #include "components/history/core/test/history_client_fake_bookmarks.h" |
27 #include "content/public/test/test_browser_thread.h" | 27 #include "content/public/test/test_browser_thread.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
29 #include "third_party/skia/include/core/SkBitmap.h" | 29 #include "third_party/skia/include/core/SkBitmap.h" |
30 #include "ui/gfx/codec/jpeg_codec.h" | 30 #include "ui/gfx/codec/jpeg_codec.h" |
31 | 31 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 base::MessageLoopForUI message_loop_; | 99 base::MessageLoopForUI message_loop_; |
100 content::TestBrowserThread ui_thread_; | 100 content::TestBrowserThread ui_thread_; |
101 content::TestBrowserThread db_thread_; | 101 content::TestBrowserThread db_thread_; |
102 | 102 |
103 ExpireHistoryBackend expirer_; | 103 ExpireHistoryBackend expirer_; |
104 | 104 |
105 scoped_ptr<HistoryDatabase> main_db_; | 105 scoped_ptr<HistoryDatabase> main_db_; |
106 scoped_ptr<ThumbnailDatabase> thumb_db_; | 106 scoped_ptr<ThumbnailDatabase> thumb_db_; |
107 TestingProfile profile_; | 107 TestingProfile profile_; |
108 scoped_refptr<TopSites> top_sites_; | 108 scoped_refptr<TopSitesProvider> top_sites_; |
109 | 109 |
110 // Time at the beginning of the test, so everybody agrees what "now" is. | 110 // Time at the beginning of the test, so everybody agrees what "now" is. |
111 const Time now_; | 111 const Time now_; |
112 | 112 |
113 // Notifications intended to be broadcast, we can check these values to make | 113 // Notifications intended to be broadcast, we can check these values to make |
114 // sure that the deletor is doing the correct broadcasts. We own the details | 114 // sure that the deletor is doing the correct broadcasts. We own the details |
115 // pointers. | 115 // pointers. |
116 typedef std::vector< std::pair<int, HistoryDetails*> > | 116 typedef std::vector< std::pair<int, HistoryDetails*> > |
117 NotificationList; | 117 NotificationList; |
118 NotificationList notifications_; | 118 NotificationList notifications_; |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); | 873 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); |
874 EXPECT_EQ(1U, visits.size()); | 874 EXPECT_EQ(1U, visits.size()); |
875 } | 875 } |
876 | 876 |
877 // TODO(brettw) add some visits with no URL to make sure everything is updated | 877 // TODO(brettw) add some visits with no URL to make sure everything is updated |
878 // properly. Have the visits also refer to nonexistent FTS rows. | 878 // properly. Have the visits also refer to nonexistent FTS rows. |
879 // | 879 // |
880 // Maybe also refer to invalid favicons. | 880 // Maybe also refer to invalid favicons. |
881 | 881 |
882 } // namespace history | 882 } // namespace history |
OLD | NEW |