OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/download_suggestions_provider.h" | 5 #include "chrome/browser/ntp_snippets/download_suggestions_provider.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "chrome/browser/ntp_snippets/fake_download_item.h" | 12 #include "chrome/browser/ntp_snippets/fake_download_item.h" |
13 #include "components/ntp_snippets/category.h" | 13 #include "components/ntp_snippets/category.h" |
14 #include "components/ntp_snippets/category_factory.h" | 14 #include "components/ntp_snippets/category_factory.h" |
15 #include "components/ntp_snippets/mock_content_suggestions_provider_observer.h" | 15 #include "components/ntp_snippets/mock_content_suggestions_provider_observer.h" |
16 #include "components/ntp_snippets/offline_pages/offline_pages_test_utils.h" | 16 #include "components/ntp_snippets/offline_pages/offline_pages_test_utils.h" |
17 #include "components/offline_pages/client_namespace_constants.h" | 17 #include "components/offline_pages/core/client_namespace_constants.h" |
18 #include "components/prefs/testing_pref_service.h" | 18 #include "components/prefs/testing_pref_service.h" |
19 #include "content/public/test/mock_download_item.h" | 19 #include "content/public/test/mock_download_item.h" |
20 #include "content/public/test/mock_download_manager.h" | 20 #include "content/public/test/mock_download_manager.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 using content::DownloadItem; | 23 using content::DownloadItem; |
24 using content::MockDownloadManager; | 24 using content::MockDownloadManager; |
25 using ntp_snippets::Category; | 25 using ntp_snippets::Category; |
26 using ntp_snippets::CategoryFactory; | 26 using ntp_snippets::CategoryFactory; |
27 using ntp_snippets::ContentSuggestion; | 27 using ntp_snippets::ContentSuggestion; |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 IgnoreOnSuggestionInvalidated(); | 916 IgnoreOnSuggestionInvalidated(); |
917 | 917 |
918 *(downloads_manager()->mutable_items()) = CreateDummyAssetDownloads({1, 2}); | 918 *(downloads_manager()->mutable_items()) = CreateDummyAssetDownloads({1, 2}); |
919 EXPECT_CALL( | 919 EXPECT_CALL( |
920 *observer(), | 920 *observer(), |
921 OnNewSuggestions(_, downloads_category(), | 921 OnNewSuggestions(_, downloads_category(), |
922 UnorderedElementsAre(HasUrl("http://download.com/1"), | 922 UnorderedElementsAre(HasUrl("http://download.com/1"), |
923 HasUrl("http://download.com/2")))); | 923 HasUrl("http://download.com/2")))); |
924 CreateProvider(/*show_assets=*/true, /*show_offline_pages=*/false); | 924 CreateProvider(/*show_assets=*/true, /*show_offline_pages=*/false); |
925 } | 925 } |
OLD | NEW |