Commit 1c910ad0 authored by Peter E Conn's avatar Peter E Conn Committed by Commit Bot

👈 Disable failing junit tests on Touchless builds.

New Tab Page and Webapp Disclosure junit tests are failing on touchless
builds. For the Webapp Disclosure these tests are not relevant - we
would never show a disclosure on a touchless device. For the New Tab
Page tests, they should probably be updated to test the touchless
specific functionality, but I'll leave that to their team. For now the
tests are just being disabled.

Bug: 981871, 981870
Change-Id: I3c88fbd26cad3e67328f4c80c1101b9b7edc65fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692164Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675659}
parent e2717410
......@@ -37,6 +37,7 @@ import android.support.v7.widget.RecyclerView.AdapterDataObserver;
import android.view.View;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
......@@ -76,6 +77,7 @@ import org.chromium.chrome.browser.suggestions.DestructionObserver;
import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter;
import org.chromium.chrome.browser.suggestions.SuggestionsRanker;
import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.chrome.test.support.DisableHistogramsRule;
import org.chromium.chrome.test.util.NewTabPageTestUtils;
import org.chromium.chrome.test.util.browser.Features;
......@@ -275,6 +277,9 @@ public class NewTabPageAdapterTest {
@Before
public void setUp() {
// These tests fail on touchless builds, see https://crbug.com/981870.
Assume.assumeFalse(FeatureUtilities.isNoTouchModeEnabled());
MockitoAnnotations.initMocks(this);
// Ensure that NetworkChangeNotifier is initialized.
......
......@@ -29,6 +29,7 @@ import static org.chromium.chrome.test.util.browser.suggestions.ContentSuggestio
import static org.chromium.chrome.test.util.browser.suggestions.ContentSuggestionsTestUtils.registerCategory;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
......@@ -56,6 +57,7 @@ import org.chromium.chrome.browser.suggestions.DestructionObserver;
import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter;
import org.chromium.chrome.browser.suggestions.SuggestionsRanker;
import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.chrome.test.support.DisableHistogramsRule;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.chrome.test.util.browser.suggestions.ContentSuggestionsTestUtils.CategoryInfoBuilder;
......@@ -100,6 +102,9 @@ public class SectionListTest {
@Before
public void setUp() {
// These tests fail on touchless builds, see https://crbug.com/981870.
Assume.assumeFalse(FeatureUtilities.isNoTouchModeEnabled());
// Ensure that NetworkChangeNotifier is initialized.
if (!NetworkChangeNotifier.isInitialized()) {
NetworkChangeNotifier.init();
......
......@@ -32,6 +32,7 @@ import static org.chromium.chrome.test.util.browser.offlinepages.FakeOfflinePage
import static org.chromium.chrome.test.util.browser.suggestions.ContentSuggestionsTestUtils.createDummySuggestions;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
......@@ -61,6 +62,7 @@ import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter;
import org.chromium.chrome.browser.suggestions.SuggestionsNavigationDelegate;
import org.chromium.chrome.browser.suggestions.SuggestionsRanker;
import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.chrome.test.support.DisableHistogramsRule;
import org.chromium.chrome.test.util.NewTabPageTestUtils;
import org.chromium.chrome.test.util.browser.Features;
......@@ -114,6 +116,9 @@ public class SuggestionsSectionTest {
@Before
public void setUp() {
// These tests fail on touchless builds, see https://crbug.com/981870.
Assume.assumeFalse(FeatureUtilities.isNoTouchModeEnabled());
RecordUserAction.setDisabledForTests(true);
MockitoAnnotations.initMocks(this);
......
......@@ -14,6 +14,7 @@ import static org.mockito.Mockito.verify;
import android.content.res.Resources;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -25,6 +26,7 @@ import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.snackbar.Snackbar;
import org.chromium.chrome.browser.snackbar.SnackbarManager;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.webapk.lib.common.WebApkConstants;
/**
......@@ -42,6 +44,10 @@ public class WebappDisclosureSnackbarControllerTest {
@Before
public void setUp() throws InterruptedException {
// These tests are not applicable on touchless builds because snackbars/infobars are not
// shown on them, see https://crbug.com/981871.
Assume.assumeFalse(FeatureUtilities.isNoTouchModeEnabled());
MockitoAnnotations.initMocks(this);
doReturn("test text").when(mResources).getString(anyInt());
......
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