Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(657)

Side by Side Diff: chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc

Issue 2651233002: Enable download home by default (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ntp_snippets/download_suggestions_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/ptr_util.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 DownloadSuggestionsProvider* CreateProvider(bool show_assets, 278 DownloadSuggestionsProvider* CreateProvider(bool show_assets,
279 bool show_offline_pages) { 279 bool show_offline_pages) {
280 DCHECK(!provider_); 280 DCHECK(!provider_);
281 DCHECK(show_assets || show_offline_pages); 281 DCHECK(show_assets || show_offline_pages);
282 282
283 // TODO(crbug.com/681766): Extract DownloadHistory interface and move 283 // TODO(crbug.com/681766): Extract DownloadHistory interface and move
284 // implementation into DownloadHistoryImpl. Then mock it. 284 // implementation into DownloadHistoryImpl. Then mock it.
285 provider_ = base::MakeUnique<DownloadSuggestionsProvider>( 285 provider_ = base::MakeUnique<DownloadSuggestionsProvider>(
286 &observer_, show_offline_pages ? &offline_pages_model_ : nullptr, 286 &observer_, show_offline_pages ? &offline_pages_model_ : nullptr,
287 show_assets ? &downloads_manager_ : nullptr, &download_history_, 287 show_assets ? &downloads_manager_ : nullptr, &download_history_,
288 pref_service(), 288 pref_service());
289 /*download_manager_ui_enabled=*/false);
290 return provider_.get(); 289 return provider_.get();
291 } 290 }
292 291
293 void DestroyProvider() { provider_.reset(); } 292 void DestroyProvider() { provider_.reset(); }
294 293
295 Category downloads_category() { 294 Category downloads_category() {
296 return Category::FromKnownCategory( 295 return Category::FromKnownCategory(
297 ntp_snippets::KnownCategories::DOWNLOADS); 296 ntp_snippets::KnownCategories::DOWNLOADS);
298 } 297 }
299 298
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1008
1010 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)); 1009 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _));
1011 1010
1012 downloads_manager()->mutable_items()->clear(); 1011 downloads_manager()->mutable_items()->clear();
1013 FireHistoryQueryComplete(); 1012 FireHistoryQueryComplete();
1014 1013
1015 *(downloads_manager()->mutable_items()) = CreateDummyAssetDownloads({1}); 1014 *(downloads_manager()->mutable_items()) = CreateDummyAssetDownloads({1});
1016 // Once the manager has been loaded, the ids should be pruned. 1015 // Once the manager has been loaded, the ids should be pruned.
1017 EXPECT_THAT(GetDismissedSuggestions(), IsEmpty()); 1016 EXPECT_THAT(GetDismissedSuggestions(), IsEmpty());
1018 } 1017 }
OLDNEW
« no previous file with comments | « chrome/browser/ntp_snippets/download_suggestions_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698