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/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/files/scoped_temp_dir.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
15 #include "base/scoped_temp_dir.h" | |
16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
17 #include "base/string16.h" | 17 #include "base/string16.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/bookmarks/bookmark_model.h" | 19 #include "chrome/browser/bookmarks/bookmark_model.h" |
20 #include "chrome/browser/bookmarks/bookmark_utils.h" | 20 #include "chrome/browser/bookmarks/bookmark_utils.h" |
21 #include "chrome/browser/history/archived_database.h" | 21 #include "chrome/browser/history/archived_database.h" |
22 #include "chrome/browser/history/expire_history_backend.h" | 22 #include "chrome/browser/history/expire_history_backend.h" |
23 #include "chrome/browser/history/history_database.h" | 23 #include "chrome/browser/history/history_database.h" |
24 #include "chrome/browser/history/history_notifications.h" | 24 #include "chrome/browser/history/history_notifications.h" |
25 #include "chrome/browser/history/text_database_manager.h" | 25 #include "chrome/browser/history/text_database_manager.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 bookmark_model_.AddURL( | 92 bookmark_model_.AddURL( |
93 bookmark_model_.bookmark_bar_node(), 0, string16(), url); | 93 bookmark_model_.bookmark_bar_node(), 0, string16(), url); |
94 } | 94 } |
95 | 95 |
96 static bool IsStringInFile(const FilePath& filename, const char* str); | 96 static bool IsStringInFile(const FilePath& filename, const char* str); |
97 | 97 |
98 // Returns the path the db files are created in. | 98 // Returns the path the db files are created in. |
99 const FilePath& path() const { return tmp_dir_.path(); } | 99 const FilePath& path() const { return tmp_dir_.path(); } |
100 | 100 |
101 // This must be destroyed last. | 101 // This must be destroyed last. |
102 ScopedTempDir tmp_dir_; | 102 base::ScopedTempDir tmp_dir_; |
103 | 103 |
104 BookmarkModel bookmark_model_; | 104 BookmarkModel bookmark_model_; |
105 | 105 |
106 MessageLoopForUI message_loop_; | 106 MessageLoopForUI message_loop_; |
107 content::TestBrowserThread ui_thread_; | 107 content::TestBrowserThread ui_thread_; |
108 content::TestBrowserThread db_thread_; | 108 content::TestBrowserThread db_thread_; |
109 | 109 |
110 ExpireHistoryBackend expirer_; | 110 ExpireHistoryBackend expirer_; |
111 | 111 |
112 scoped_ptr<HistoryDatabase> main_db_; | 112 scoped_ptr<HistoryDatabase> main_db_; |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 main_db_->GetVisitsForURL(url_id, &archived_visits); | 956 main_db_->GetVisitsForURL(url_id, &archived_visits); |
957 EXPECT_EQ(0U, archived_visits.size()); | 957 EXPECT_EQ(0U, archived_visits.size()); |
958 } | 958 } |
959 | 959 |
960 // TODO(brettw) add some visits with no URL to make sure everything is updated | 960 // TODO(brettw) add some visits with no URL to make sure everything is updated |
961 // properly. Have the visits also refer to nonexistent FTS rows. | 961 // properly. Have the visits also refer to nonexistent FTS rows. |
962 // | 962 // |
963 // Maybe also refer to invalid favicons. | 963 // Maybe also refer to invalid favicons. |
964 | 964 |
965 } // namespace history | 965 } // namespace history |
OLD | NEW |