Chromium Code Reviews| 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/history_details.h" | |
|
sdefresne
2014/12/08 17:41:06
You should be able to remove this #include if you
nshaik
2014/12/08 21:29:52
Done.
| |
| 20 #include "chrome/browser/history/thumbnail_database.h" | 21 #include "chrome/browser/history/thumbnail_database.h" |
| 21 #include "chrome/browser/history/top_sites.h" | 22 #include "chrome/browser/history/top_sites.h" |
| 22 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 23 #include "chrome/tools/profiles/thumbnail-inl.h" | 24 #include "chrome/tools/profiles/thumbnail-inl.h" |
| 24 #include "components/history/core/browser/history_backend_notifier.h" | 25 #include "components/history/core/browser/history_backend_notifier.h" |
| 25 #include "components/history/core/common/thumbnail_score.h" | 26 #include "components/history/core/common/thumbnail_score.h" |
| 26 #include "components/history/core/test/history_client_fake_bookmarks.h" | 27 #include "components/history/core/test/history_client_fake_bookmarks.h" |
| 27 #include "content/public/test/test_browser_thread.h" | 28 #include "content/public/test/test_browser_thread.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 scoped_ptr<ThumbnailDatabase> thumb_db_; | 107 scoped_ptr<ThumbnailDatabase> thumb_db_; |
| 107 TestingProfile profile_; | 108 TestingProfile profile_; |
| 108 scoped_refptr<TopSites> top_sites_; | 109 scoped_refptr<TopSites> top_sites_; |
| 109 | 110 |
| 110 // Time at the beginning of the test, so everybody agrees what "now" is. | 111 // Time at the beginning of the test, so everybody agrees what "now" is. |
| 111 const Time now_; | 112 const Time now_; |
| 112 | 113 |
| 113 // Notifications intended to be broadcast, we can check these values to make | 114 // 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 | 115 // sure that the deletor is doing the correct broadcasts. We own the details |
| 115 // pointers. | 116 // pointers. |
| 116 typedef std::vector< std::pair<int, HistoryDetails*> > | 117 typedef std::vector< std::pair<int, HistoryDetails*> > |
|
sdefresne
2014/12/08 17:41:06
I think this typedef and the corresponding instanc
nshaik
2014/12/08 21:29:52
Done.
| |
| 117 NotificationList; | 118 NotificationList; |
| 118 NotificationList notifications_; | 119 NotificationList notifications_; |
| 119 | 120 |
| 120 typedef std::vector<URLRows> URLsModifiedNotificationList; | 121 typedef std::vector<URLRows> URLsModifiedNotificationList; |
| 121 URLsModifiedNotificationList urls_modified_notifications_; | 122 URLsModifiedNotificationList urls_modified_notifications_; |
| 122 | 123 |
| 123 typedef std::vector<std::pair<bool, URLRows>> URLsDeletedNotificationList; | 124 typedef std::vector<std::pair<bool, URLRows>> URLsDeletedNotificationList; |
| 124 URLsDeletedNotificationList urls_deleted_notifications_; | 125 URLsDeletedNotificationList urls_deleted_notifications_; |
| 125 | 126 |
| 126 private: | 127 private: |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 873 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); | 874 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); |
| 874 EXPECT_EQ(1U, visits.size()); | 875 EXPECT_EQ(1U, visits.size()); |
| 875 } | 876 } |
| 876 | 877 |
| 877 // TODO(brettw) add some visits with no URL to make sure everything is updated | 878 // 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. | 879 // properly. Have the visits also refer to nonexistent FTS rows. |
| 879 // | 880 // |
| 880 // Maybe also refer to invalid favicons. | 881 // Maybe also refer to invalid favicons. |
| 881 | 882 |
| 882 } // namespace history | 883 } // namespace history |
| OLD | NEW |