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/memory/ptr_util.h" |
10 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
12 #include "chrome/browser/ntp_snippets/fake_download_item.h" | 13 #include "chrome/browser/ntp_snippets/fake_download_item.h" |
13 #include "components/ntp_snippets/category.h" | 14 #include "components/ntp_snippets/category.h" |
14 #include "components/ntp_snippets/mock_content_suggestions_provider_observer.h" | 15 #include "components/ntp_snippets/mock_content_suggestions_provider_observer.h" |
15 #include "components/ntp_snippets/offline_pages/offline_pages_test_utils.h" | 16 #include "components/ntp_snippets/offline_pages/offline_pages_test_utils.h" |
16 #include "components/offline_pages/core/client_namespace_constants.h" | 17 #include "components/offline_pages/core/client_namespace_constants.h" |
17 #include "components/prefs/testing_pref_service.h" | 18 #include "components/prefs/testing_pref_service.h" |
18 #include "content/public/test/mock_download_item.h" | 19 #include "content/public/test/mock_download_item.h" |
19 #include "content/public/test/mock_download_manager.h" | 20 #include "content/public/test/mock_download_manager.h" |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 EXPECT_THAT(GetDismissedSuggestions(), SizeIs(kMaxDismissedIdCount)); | 1000 EXPECT_THAT(GetDismissedSuggestions(), SizeIs(kMaxDismissedIdCount)); |
1000 DestroyProvider(); | 1001 DestroyProvider(); |
1001 // The oldest dismissed suggestion must become undismissed now. This is a | 1002 // The oldest dismissed suggestion must become undismissed now. This is a |
1002 // temporary workaround and not what we want in long term. This test must be | 1003 // temporary workaround and not what we want in long term. This test must be |
1003 // removed once we start pruning dismissed asset downloads on startup. | 1004 // removed once we start pruning dismissed asset downloads on startup. |
1004 EXPECT_CALL(*observer(), | 1005 EXPECT_CALL(*observer(), |
1005 OnNewSuggestions(_, downloads_category(), | 1006 OnNewSuggestions(_, downloads_category(), |
1006 ElementsAre(HasUrl("http://download.com/0")))); | 1007 ElementsAre(HasUrl("http://download.com/0")))); |
1007 CreateProvider(/*show_assets=*/true, /*show_offline_pages=*/false); | 1008 CreateProvider(/*show_assets=*/true, /*show_offline_pages=*/false); |
1008 } | 1009 } |
OLD | NEW |