| 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;
|
| }
|
|
|
|
|