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

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: aaaand rebase again 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 a477c2ca1c4de3d2833c688638a83bf3389f96a4..608ddc39d348a2993eaea04fdd7c87eda251bd47 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);
bindViewHolders(sectionList);
@@ -119,7 +119,7 @@ public void testGetSuggestionRankWithChanges() {
List<SnippetArticle> bookmarks =
registerCategory(mSuggestionSource, KnownCategories.BOOKMARKS, 4);
- SectionList sectionList = new SectionList(mNtpManager, mOfflinePageBridge);
+ SectionList sectionList = new SectionList(mUiDelegate, mOfflinePageBridge);
bindViewHolders(sectionList, 0, 5); // Bind until after the third article.
@@ -219,7 +219,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