OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
18 #include "chrome/browser/history/archived_database.h" | 18 #include "chrome/browser/history/archived_database.h" |
19 #include "chrome/browser/history/expire_history_backend.h" | 19 #include "chrome/browser/history/expire_history_backend.h" |
20 #include "chrome/browser/history/history_database.h" | 20 #include "chrome/browser/history/history_database.h" |
21 #include "chrome/browser/history/history_notifications.h" | 21 #include "chrome/browser/history/history_notifications.h" |
22 #include "chrome/browser/history/text_database_manager.h" | 22 #include "chrome/browser/history/text_database_manager.h" |
23 #include "chrome/browser/history/thumbnail_database.h" | 23 #include "chrome/browser/history/thumbnail_database.h" |
24 #include "chrome/browser/history/top_sites.h" | 24 #include "chrome/browser/history/top_sites.h" |
25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
26 #include "chrome/common/thumbnail_score.h" | 26 #include "chrome/common/thumbnail_score.h" |
27 #include "chrome/test/base/testing_browser_process_test.h" | |
28 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
29 #include "chrome/tools/profiles/thumbnail-inl.h" | 28 #include "chrome/tools/profiles/thumbnail-inl.h" |
30 #include "content/browser/browser_thread.h" | 29 #include "content/browser/browser_thread.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
32 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
33 #include "ui/gfx/codec/jpeg_codec.h" | 32 #include "ui/gfx/codec/jpeg_codec.h" |
34 | 33 |
35 using base::Time; | 34 using base::Time; |
36 using base::TimeDelta; | 35 using base::TimeDelta; |
37 using base::TimeTicks; | 36 using base::TimeTicks; |
38 | 37 |
39 // Filename constants. | 38 // Filename constants. |
40 static const FilePath::CharType kHistoryFile[] = FILE_PATH_LITERAL("History"); | 39 static const FilePath::CharType kHistoryFile[] = FILE_PATH_LITERAL("History"); |
41 static const FilePath::CharType kArchivedHistoryFile[] = | 40 static const FilePath::CharType kArchivedHistoryFile[] = |
42 FILE_PATH_LITERAL("Archived History"); | 41 FILE_PATH_LITERAL("Archived History"); |
43 static const FilePath::CharType kThumbnailFile[] = | 42 static const FilePath::CharType kThumbnailFile[] = |
44 FILE_PATH_LITERAL("Thumbnails"); | 43 FILE_PATH_LITERAL("Thumbnails"); |
45 | 44 |
46 // The test must be in the history namespace for the gtest forward declarations | 45 // The test must be in the history namespace for the gtest forward declarations |
47 // to work. It also eliminates a bunch of ugly "history::". | 46 // to work. It also eliminates a bunch of ugly "history::". |
48 namespace history { | 47 namespace history { |
49 | 48 |
50 // ExpireHistoryTest ----------------------------------------------------------- | 49 // ExpireHistoryTest ----------------------------------------------------------- |
51 | 50 |
52 class ExpireHistoryTest : public TestingBrowserProcessTest, | 51 class ExpireHistoryTest : public testing::Test, |
53 public BroadcastNotificationDelegate { | 52 public BroadcastNotificationDelegate { |
54 public: | 53 public: |
55 ExpireHistoryTest() | 54 ExpireHistoryTest() |
56 : bookmark_model_(NULL), | 55 : bookmark_model_(NULL), |
57 ui_thread_(BrowserThread::UI, &message_loop_), | 56 ui_thread_(BrowserThread::UI, &message_loop_), |
58 db_thread_(BrowserThread::DB, &message_loop_), | 57 db_thread_(BrowserThread::DB, &message_loop_), |
59 ALLOW_THIS_IN_INITIALIZER_LIST(expirer_(this, &bookmark_model_)), | 58 ALLOW_THIS_IN_INITIALIZER_LIST(expirer_(this, &bookmark_model_)), |
60 now_(Time::Now()) { | 59 now_(Time::Now()) { |
61 } | 60 } |
62 | 61 |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 main_db_->GetVisitsForURL(url_id, &archived_visits); | 912 main_db_->GetVisitsForURL(url_id, &archived_visits); |
914 EXPECT_EQ(0U, archived_visits.size()); | 913 EXPECT_EQ(0U, archived_visits.size()); |
915 } | 914 } |
916 | 915 |
917 // TODO(brettw) add some visits with no URL to make sure everything is updated | 916 // TODO(brettw) add some visits with no URL to make sure everything is updated |
918 // properly. Have the visits also refer to nonexistent FTS rows. | 917 // properly. Have the visits also refer to nonexistent FTS rows. |
919 // | 918 // |
920 // Maybe also refer to invalid favicons. | 919 // Maybe also refer to invalid favicons. |
921 | 920 |
922 } // namespace history | 921 } // namespace history |
OLD | NEW |