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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2504113003: Add NewTabPageRecyclerViewTest. (Closed)
Patch Set: Address review comment from bauerb. Created 4 years, 1 month 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/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index 7be3f766f6e694477fb6e8d573e052de63c3e347..6798afae57e1ca9c516ad748bd95ab77f668cf31 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -112,6 +112,7 @@ public class NewTabPage
"https://www.googleapis.com/auth/chrome-content-suggestions";
private static MostVisitedSites sMostVisitedSitesForTests;
+ private static SuggestionsSource sSuggestionsSourceForTests;
private final Tab mTab;
private final TabModelSelector mTabModelSelector;
@@ -217,10 +218,15 @@ public class NewTabPage
}
@VisibleForTesting
- static void setMostVisitedSitesForTests(MostVisitedSites mostVisitedSitesForTests) {
+ public static void setMostVisitedSitesForTests(MostVisitedSites mostVisitedSitesForTests) {
sMostVisitedSitesForTests = mostVisitedSitesForTests;
}
+ @VisibleForTesting
+ public static void setSuggestionsSourceForTests(SuggestionsSource suggestionsSource) {
+ sSuggestionsSourceForTests = suggestionsSource;
+ }
+
private final NewTabPageManager mNewTabPageManager = new NewTabPageManager() {
private static final String NTP_OFFLINE_PAGES_FEATURE_NAME = "NTPOfflinePages";
@@ -653,6 +659,7 @@ public class NewTabPage
@Override
public SuggestionsSource getSuggestionsSource() {
+ if (sSuggestionsSourceForTests != null) return sSuggestionsSourceForTests;
return mSnippetsBridge;
}
@@ -777,7 +784,7 @@ public class NewTabPage
/** @return The view container for the new tab page. */
@VisibleForTesting
- NewTabPageView getNewTabPageView() {
+ public NewTabPageView getNewTabPageView() {
return mNewTabPageView;
}

Powered by Google App Engine
This is Rietveld 408576698