Commit 79a6ffe5 authored by Theresa's avatar Theresa Committed by Commit Bot

Remove FeedNewTabPage tests from NewTabPageTest.java

BUG=854866

Change-Id: Icb0b087efca580ca640a346ed916103b36c50bff
Reviewed-on: https://chromium-review.googlesource.com/1113797Reviewed-by: default avatarBecky Zhou <huayinz@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570076}
parent 5aace472
...@@ -12,7 +12,6 @@ import android.app.Activity; ...@@ -12,7 +12,6 @@ import android.app.Activity;
import android.app.Instrumentation; import android.app.Instrumentation;
import android.app.Instrumentation.ActivityMonitor; import android.app.Instrumentation.ActivityMonitor;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Build;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
import android.support.test.filters.LargeTest; import android.support.test.filters.LargeTest;
import android.support.test.filters.MediumTest; import android.support.test.filters.MediumTest;
...@@ -71,7 +70,6 @@ import org.chromium.chrome.test.util.NewTabPageTestUtils; ...@@ -71,7 +70,6 @@ import org.chromium.chrome.test.util.NewTabPageTestUtils;
import org.chromium.chrome.test.util.OmniboxTestUtils; import org.chromium.chrome.test.util.OmniboxTestUtils;
import org.chromium.chrome.test.util.RenderTestRule; import org.chromium.chrome.test.util.RenderTestRule;
import org.chromium.chrome.test.util.browser.ChromeModernDesign; import org.chromium.chrome.test.util.browser.ChromeModernDesign;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.Features.DisableFeatures;
import org.chromium.chrome.test.util.browser.Features.EnableFeatures; import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
...@@ -131,15 +129,6 @@ public class NewTabPageTest { ...@@ -131,15 +129,6 @@ public class NewTabPageTest {
} }
} }
/** Parameter provider for enabling/disabling "Interest Feed Content Suggestions". */
public static class InterestFeedParams implements ParameterProvider {
@Override
public Iterable<ParameterSet> getParameters() {
return Arrays.asList(new ParameterSet().value(false).name("DisableInterestFeed"),
new ParameterSet().value(true).name("EnableInterestFeed"));
}
}
private static final String TEST_PAGE = "/chrome/test/data/android/navigate/simple.html"; private static final String TEST_PAGE = "/chrome/test/data/android/navigate/simple.html";
private Tab mTab; private Tab mTab;
...@@ -162,20 +151,6 @@ public class NewTabPageTest { ...@@ -162,20 +151,6 @@ public class NewTabPageTest {
mChromeModernProcessor.clearTestState(); mChromeModernProcessor.clearTestState();
} }
@ParameterAnnotations.UseMethodParameterBefore(InterestFeedParams.class)
public void setupInterestFeed(boolean interestFeedEnabled) {
// TODO(twellington): Re-enable interest Feed test on arm64 M. See https://crbug.com/854866.
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M
&& Arrays.asList(Build.SUPPORTED_ABIS).contains("arm64-v8a")) {
interestFeedEnabled = false;
}
if (interestFeedEnabled) {
Features.getInstance().enable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
} else {
Features.getInstance().disable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
}
}
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
...@@ -259,8 +234,7 @@ public class NewTabPageTest { ...@@ -259,8 +234,7 @@ public class NewTabPageTest {
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP}) @EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testSimplifiedNtp_BookmarksShortcuts() {
public void testSimplifiedNtp_BookmarksShortcuts(boolean interestFeedEnabled) {
ActivityMonitor activityMonitor = InstrumentationRegistry.getInstrumentation().addMonitor( ActivityMonitor activityMonitor = InstrumentationRegistry.getInstrumentation().addMonitor(
BookmarkActivity.class.getName(), BookmarkActivity.class.getName(),
new Instrumentation.ActivityResult(Activity.RESULT_OK, null), true); new Instrumentation.ActivityResult(Activity.RESULT_OK, null), true);
...@@ -278,8 +252,7 @@ public class NewTabPageTest { ...@@ -278,8 +252,7 @@ public class NewTabPageTest {
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP}) @EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testSimplifiedNtp_DownloadsShortcuts() {
public void testSimplifiedNtp_DownloadsShortcuts(boolean interestFeedEnabled) {
ActivityMonitor activityMonitor = InstrumentationRegistry.getInstrumentation().addMonitor( ActivityMonitor activityMonitor = InstrumentationRegistry.getInstrumentation().addMonitor(
DownloadActivity.class.getName(), DownloadActivity.class.getName(),
new Instrumentation.ActivityResult(Activity.RESULT_OK, null), true); new Instrumentation.ActivityResult(Activity.RESULT_OK, null), true);
...@@ -297,9 +270,7 @@ public class NewTabPageTest { ...@@ -297,9 +270,7 @@ public class NewTabPageTest {
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP}) @EnableFeatures({ChromeFeatureList.SIMPLIFIED_NTP})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testSimplifiedNtp_DefaultSearchEngineChange() throws Exception {
public void testSimplifiedNtp_DefaultSearchEngineChange(boolean interestFeedEnabled)
throws Exception {
View logo = mNtp.getView().findViewById(R.id.search_provider_logo); View logo = mNtp.getView().findViewById(R.id.search_provider_logo);
View shortcuts = mNtp.getView().findViewById(R.id.shortcuts); View shortcuts = mNtp.getView().findViewById(R.id.shortcuts);
Assert.assertEquals(View.VISIBLE, logo.getVisibility()); Assert.assertEquals(View.VISIBLE, logo.getVisibility());
...@@ -410,8 +381,7 @@ public class NewTabPageTest { ...@@ -410,8 +381,7 @@ public class NewTabPageTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testClickMostVisitedItem() throws InterruptedException {
public void testClickMostVisitedItem(boolean interestFeedEnabled) throws InterruptedException {
ChromeTabUtils.waitForTabPageLoaded(mTab, new Runnable() { ChromeTabUtils.waitForTabPageLoaded(mTab, new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -441,8 +411,7 @@ public class NewTabPageTest { ...@@ -441,8 +411,7 @@ public class NewTabPageTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testOpenMostVisitedItemInIncognitoTab()
public void testOpenMostVisitedItemInIncognitoTab(boolean interestFeedEnabled)
throws InterruptedException, ExecutionException { throws InterruptedException, ExecutionException {
ChromeTabUtils.invokeContextMenuAndOpenInANewTab(mActivityTestRule, ChromeTabUtils.invokeContextMenuAndOpenInANewTab(mActivityTestRule,
mTileGridLayout.getChildAt(0), ContextMenuManager.ID_OPEN_IN_INCOGNITO_TAB, true, mTileGridLayout.getChildAt(0), ContextMenuManager.ID_OPEN_IN_INCOGNITO_TAB, true,
...@@ -455,8 +424,7 @@ public class NewTabPageTest { ...@@ -455,8 +424,7 @@ public class NewTabPageTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testRemoveMostVisitedItem() throws ExecutionException {
public void testRemoveMostVisitedItem(boolean interestFeedEnabled) throws ExecutionException {
SiteSuggestion testSite = mSiteSuggestions.get(0); SiteSuggestion testSite = mSiteSuggestions.get(0);
View mostVisitedItem = mTileGridLayout.getChildAt(0); View mostVisitedItem = mTileGridLayout.getChildAt(0);
ArrayList<View> views = new ArrayList<>(); ArrayList<View> views = new ArrayList<>();
...@@ -474,9 +442,7 @@ public class NewTabPageTest { ...@@ -474,9 +442,7 @@ public class NewTabPageTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testUrlFocusAnimationsDisabledOnLoad() throws InterruptedException {
public void testUrlFocusAnimationsDisabledOnLoad(boolean interestFeedEnabled)
throws InterruptedException {
Assert.assertFalse(getUrlFocusAnimationsDisabled()); Assert.assertFalse(getUrlFocusAnimationsDisabled());
ChromeTabUtils.waitForTabPageLoaded(mTab, new Runnable() { ChromeTabUtils.waitForTabPageLoaded(mTab, new Runnable() {
@Override @Override
...@@ -568,8 +534,7 @@ public class NewTabPageTest { ...@@ -568,8 +534,7 @@ public class NewTabPageTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testSetSearchProviderInfo() throws Throwable {
public void testSetSearchProviderInfo(boolean interestFeedEnabled) throws Throwable {
mActivityTestRule.runOnUiThread(new Runnable() { mActivityTestRule.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -591,8 +556,7 @@ public class NewTabPageTest { ...@@ -591,8 +556,7 @@ public class NewTabPageTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"NewTabPage", "FeedNewTabPage"}) @Feature({"NewTabPage", "FeedNewTabPage"})
@ParameterAnnotations.UseMethodParameter(InterestFeedParams.class) public void testPlaceholder() {
public void testPlaceholder(boolean interestFeedEnabled) {
final NewTabPageLayout ntpLayout = mNtp.getNewTabPageLayout(); final NewTabPageLayout ntpLayout = mNtp.getNewTabPageLayout();
final View logoView = ntpLayout.findViewById(R.id.search_provider_logo); final View logoView = ntpLayout.findViewById(R.id.search_provider_logo);
final View searchBoxView = ntpLayout.findViewById(R.id.search_box); final View searchBoxView = ntpLayout.findViewById(R.id.search_box);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment