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

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

Issue 2623993007: 🏠 Extract the ContentSuggestionManager interface from NTP (Closed)
Patch Set: address comments 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/SectionListTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java
index 452238ffd3a4d5c17d800c7f682cafb976718005..0721dce4786ab37577702457a801492168afa75b 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java
@@ -21,7 +21,6 @@
import org.chromium.base.Callback;
import org.chromium.base.test.util.Feature;
-import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
import org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.CategoryInfoBuilder;
import org.chromium.chrome.browser.ntp.snippets.CategoryInt;
import org.chromium.chrome.browser.ntp.snippets.FakeSuggestionsSource;
@@ -31,6 +30,7 @@
import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
import org.chromium.chrome.browser.suggestions.SuggestionsMetricsReporter;
+import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate;
import org.chromium.testing.local.LocalRobolectricTestRunner;
import java.util.Collections;
@@ -43,7 +43,7 @@
@Config(manifest = Config.NONE)
public class SectionListTest {
@Mock
- private NewTabPageManager mNtpManager;
+ private SuggestionsUiDelegate mUiDelegate;
@Mock
private OfflinePageBridge mOfflinePageBridge;
@Mock
@@ -55,8 +55,8 @@ public void setUp() {
MockitoAnnotations.initMocks(this);
mSuggestionSource = new FakeSuggestionsSource();
- when(mNtpManager.getSuggestionsSource()).thenReturn(mSuggestionSource);
- when(mNtpManager.getSuggestionsMetricsReporter()).thenReturn(mMetricsReporter);
+ when(mUiDelegate.getSuggestionsSource()).thenReturn(mSuggestionSource);
+ when(mUiDelegate.getMetricsReporter()).thenReturn(mMetricsReporter);
}
@Test
@@ -83,7 +83,7 @@ public void testGetSuggestionRank() {
List<SnippetArticle> bookmarks =
registerCategory(mSuggestionSource, KnownCategories.BOOKMARKS, 4);
- SectionList sectionList = new SectionList(mNtpManager, mOfflinePageBridge);
+ SectionList sectionList = new SectionList(mUiDelegate, mOfflinePageBridge);
assertThat(articles.get(0).getGlobalRank(), equalTo(0));
assertThat(articles.get(0).getPerSectionRank(), equalTo(0));
@@ -147,7 +147,7 @@ public void testGetActionItemRank() {
registerCategory(mSuggestionSource,
new CategoryInfoBuilder(KnownCategories.DOWNLOADS).withViewAllAction().build(), 3);
- SectionList sectionList = new SectionList(mNtpManager, mOfflinePageBridge);
+ SectionList sectionList = new SectionList(mUiDelegate, mOfflinePageBridge);
bindViewHolders(sectionList);
assertThat(sectionList.getSectionForTesting(KnownCategories.ARTICLES)

Powered by Google App Engine
This is Rietveld 408576698