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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java

Issue 2618893003: 📰 Tweak the suggestion ranks for UMA to handle fetchMore (Closed)
Patch Set: Fix action item reported position 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
index 1336e85b1d0823e050478cebd5c1b46e42ae859a..7b3cb808392878d9ca67bd5487b7c47b1de6403d 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
@@ -35,10 +35,12 @@
import org.chromium.chrome.browser.EnableFeatures;
import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
import org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.CategoryInfoBuilder;
+import org.chromium.chrome.browser.ntp.cards.SectionList.SuggestionRanker;
import org.chromium.chrome.browser.ntp.snippets.CategoryStatus;
import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource;
import org.chromium.chrome.browser.offlinepages.OfflinePageItem;
+import org.chromium.chrome.browser.suggestions.SuggestionsMetricsReporter;
import org.chromium.testing.local.LocalRobolectricTestRunner;
import java.util.Arrays;
@@ -462,7 +464,8 @@ private SuggestionsSection createSectionWithReloadAction(boolean hasReloadAction
}
private SuggestionsSection createSection(SuggestionsCategoryInfo info) {
- SuggestionsSection section = new SuggestionsSection(mDelegate, mManager, mBridge, info);
+ SuggestionsSection section = new SuggestionsSection(
+ mDelegate, mManager, mock(SuggestionRanker.class), mBridge, info);
section.setParent(mParent);
return section;
}
@@ -475,6 +478,8 @@ private static void verifyAction(SuggestionsSection section, @ActionItem.Action
SuggestionsSource suggestionsSource = mock(SuggestionsSource.class);
NewTabPageManager manager = mock(NewTabPageManager.class);
when(manager.getSuggestionsSource()).thenReturn(suggestionsSource);
+ when(manager.getSuggestionsMetricsReporter())
+ .thenReturn(mock(SuggestionsMetricsReporter.class));
if (action != ActionItem.ACTION_NONE) {
section.getActionItem().performAction(manager);

Powered by Google App Engine
This is Rietveld 408576698