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" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/strings/stringprintf.h" | |
15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
17 #include "chrome/browser/history/chrome_history_client.h" | 16 #include "chrome/browser/history/chrome_history_client.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
20 #include "chrome/test/base/testing_browser_process.h" | 19 #include "chrome/test/base/testing_browser_process.h" |
21 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
22 #include "chrome/test/base/testing_profile_manager.h" | 21 #include "chrome/test/base/testing_profile_manager.h" |
23 #include "components/bookmarks/browser/bookmark_model.h" | 22 #include "components/bookmarks/browser/bookmark_model.h" |
24 #include "components/bookmarks/test/bookmark_test_helpers.h" | 23 #include "components/bookmarks/test/bookmark_test_helpers.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 base::FilePath thumbnail_db_name_; | 255 base::FilePath thumbnail_db_name_; |
257 | 256 |
258 TestingProfileManager profile_manager_; | 257 TestingProfileManager profile_manager_; |
259 BookmarkModel* bookmark_model_; | 258 BookmarkModel* bookmark_model_; |
260 base::MessageLoopForUI message_loop_; | 259 base::MessageLoopForUI message_loop_; |
261 content::TestBrowserThread ui_thread_; | 260 content::TestBrowserThread ui_thread_; |
262 content::TestBrowserThread file_thread_; | 261 content::TestBrowserThread file_thread_; |
263 std::unique_ptr<history::HistoryClient> history_client_; | 262 std::unique_ptr<history::HistoryClient> history_client_; |
264 std::unique_ptr<history::HistoryBackendClient> history_backend_client_; | 263 std::unique_ptr<history::HistoryBackendClient> history_backend_client_; |
265 | 264 |
| 265 private: |
266 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendTest); | 266 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendTest); |
267 }; | 267 }; |
268 | 268 |
269 TEST_F(AndroidProviderBackendTest, IgnoreAboutBlank) { | 269 TEST_F(AndroidProviderBackendTest, IgnoreAboutBlank) { |
270 GURL url("about:blank"); | 270 GURL url("about:blank"); |
271 ASSERT_FALSE(history_client_->CanAddURL(url)); | 271 ASSERT_FALSE(history_client_->CanAddURL(url)); |
272 } | 272 } |
273 | 273 |
274 TEST_F(AndroidProviderBackendTest, UpdateTables) { | 274 TEST_F(AndroidProviderBackendTest, UpdateTables) { |
275 GURL url1("http://www.cnn.com"); | 275 GURL url1("http://www.cnn.com"); |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 update_args, &update_count)); | 2093 update_args, &update_count)); |
2094 // Verify notifications. | 2094 // Verify notifications. |
2095 EXPECT_FALSE(notifier_.deleted_details()); | 2095 EXPECT_FALSE(notifier_.deleted_details()); |
2096 ASSERT_TRUE(notifier_.modified_details()); | 2096 ASSERT_TRUE(notifier_.modified_details()); |
2097 ASSERT_EQ(1u, notifier_.modified_details()->size()); | 2097 ASSERT_EQ(1u, notifier_.modified_details()->size()); |
2098 // No favicon will be updated as thumbnail database is missing. | 2098 // No favicon will be updated as thumbnail database is missing. |
2099 EXPECT_FALSE(notifier_.favicon_changed()); | 2099 EXPECT_FALSE(notifier_.favicon_changed()); |
2100 } | 2100 } |
2101 | 2101 |
2102 } // namespace history | 2102 } // namespace history |
OLD | NEW |