| 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 "chrome/browser/history/android/android_provider_backend.h" | 5 #include "chrome/browser/history/android/android_provider_backend.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 BookmarkModel* bookmark_model_; | 256 BookmarkModel* bookmark_model_; |
| 257 base::MessageLoopForUI message_loop_; | 257 base::MessageLoopForUI message_loop_; |
| 258 content::TestBrowserThread ui_thread_; | 258 content::TestBrowserThread ui_thread_; |
| 259 content::TestBrowserThread file_thread_; | 259 content::TestBrowserThread file_thread_; |
| 260 scoped_ptr<history::HistoryClient> history_client_; | 260 scoped_ptr<history::HistoryClient> history_client_; |
| 261 scoped_ptr<history::HistoryBackendClient> history_backend_client_; | 261 scoped_ptr<history::HistoryBackendClient> history_backend_client_; |
| 262 | 262 |
| 263 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendTest); | 263 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendTest); |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 TEST_F(AndroidProviderBackendTest, IgnoreAboutBlank) { |
| 267 GURL url("about:blank"); |
| 268 ASSERT_FALSE(history_client_->CanAddURL(url)); |
| 269 } |
| 270 |
| 266 TEST_F(AndroidProviderBackendTest, UpdateTables) { | 271 TEST_F(AndroidProviderBackendTest, UpdateTables) { |
| 267 GURL url1("http://www.cnn.com"); | 272 GURL url1("http://www.cnn.com"); |
| 268 URLID url_id1 = 0; | 273 URLID url_id1 = 0; |
| 269 std::vector<VisitInfo> visits1; | 274 std::vector<VisitInfo> visits1; |
| 270 Time last_visited1 = Time::Now() - TimeDelta::FromDays(1); | 275 Time last_visited1 = Time::Now() - TimeDelta::FromDays(1); |
| 271 Time created1 = last_visited1 - TimeDelta::FromDays(20); | 276 Time created1 = last_visited1 - TimeDelta::FromDays(20); |
| 272 visits1.push_back(VisitInfo(created1, ui::PAGE_TRANSITION_LINK)); | 277 visits1.push_back(VisitInfo(created1, ui::PAGE_TRANSITION_LINK)); |
| 273 visits1.push_back(VisitInfo(last_visited1 - TimeDelta::FromDays(1), | 278 visits1.push_back(VisitInfo(last_visited1 - TimeDelta::FromDays(1), |
| 274 ui::PAGE_TRANSITION_LINK)); | 279 ui::PAGE_TRANSITION_LINK)); |
| 275 visits1.push_back(VisitInfo(last_visited1, ui::PAGE_TRANSITION_LINK)); | 280 visits1.push_back(VisitInfo(last_visited1, ui::PAGE_TRANSITION_LINK)); |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2155 update_args, &update_count)); | 2160 update_args, &update_count)); |
| 2156 // Verify notifications. | 2161 // Verify notifications. |
| 2157 EXPECT_FALSE(notifier_.deleted_details()); | 2162 EXPECT_FALSE(notifier_.deleted_details()); |
| 2158 ASSERT_TRUE(notifier_.modified_details()); | 2163 ASSERT_TRUE(notifier_.modified_details()); |
| 2159 ASSERT_EQ(1u, notifier_.modified_details()->size()); | 2164 ASSERT_EQ(1u, notifier_.modified_details()->size()); |
| 2160 // No favicon will be updated as thumbnail database is missing. | 2165 // No favicon will be updated as thumbnail database is missing. |
| 2161 EXPECT_FALSE(notifier_.favicon_changed()); | 2166 EXPECT_FALSE(notifier_.favicon_changed()); |
| 2162 } | 2167 } |
| 2163 | 2168 |
| 2164 } // namespace history | 2169 } // namespace history |
| OLD | NEW |