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

Side by Side Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2249903003: 📰 Empty state handling for the Bookmarks section (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix instrumentation test Created 4 years, 4 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
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 "components/ntp_snippets/content_suggestions_service.h" 5 #include "components/ntp_snippets/content_suggestions_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 std::vector<Category> GetProvidedCategories() override { 74 std::vector<Category> GetProvidedCategories() override {
75 return provided_categories_; 75 return provided_categories_;
76 } 76 }
77 77
78 CategoryStatus GetCategoryStatus(Category category) { 78 CategoryStatus GetCategoryStatus(Category category) {
79 return statuses_[category.id()]; 79 return statuses_[category.id()];
80 } 80 }
81 81
82 CategoryInfo GetCategoryInfo(Category category) { 82 CategoryInfo GetCategoryInfo(Category category) {
83 return CategoryInfo(base::ASCIIToUTF16("Section title"), 83 return CategoryInfo(base::ASCIIToUTF16("Section title"),
84 ContentSuggestionsCardLayout::FULL_CARD, true); 84 ContentSuggestionsCardLayout::FULL_CARD, true, true);
85 } 85 }
86 86
87 void FireSuggestionsChanged(Category category, 87 void FireSuggestionsChanged(Category category,
88 const std::vector<int>& numbers) { 88 const std::vector<int>& numbers) {
89 observer()->OnNewSuggestions(this, category, CreateSuggestions(numbers)); 89 observer()->OnNewSuggestions(this, category, CreateSuggestions(numbers));
90 } 90 }
91 91
92 void FireCategoryStatusChanged(Category category, CategoryStatus new_status) { 92 void FireCategoryStatusChanged(Category category, CategoryStatus new_status) {
93 statuses_[category.id()] = new_status; 93 statuses_[category.id()] = new_status;
94 observer()->OnCategoryStatusChanged(this, category, new_status); 94 observer()->OnCategoryStatusChanged(this, category, new_status);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 EXPECT_THAT(service()->GetCategoryStatus(category), 498 EXPECT_THAT(service()->GetCategoryStatus(category),
499 Eq(CategoryStatus::NOT_PROVIDED)); 499 Eq(CategoryStatus::NOT_PROVIDED));
500 EXPECT_TRUE(service()->GetCategories().empty()); 500 EXPECT_TRUE(service()->GetCategories().empty());
501 ExpectThatSuggestionsAre(category, std::vector<int>()); 501 ExpectThatSuggestionsAre(category, std::vector<int>());
502 502
503 service()->RemoveObserver(&observer); 503 service()->RemoveObserver(&observer);
504 } 504 }
505 505
506 } // namespace ntp_snippets 506 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/category_info.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698