Commit 42eec2ac authored by Josh Simmons's avatar Josh Simmons Committed by Commit Bot

Revert "Add network restriction for translate tests so we can reenable them."

This reverts commit 568372e8.

Reason for revert: While these now skip the Marshmallow bot due to lack of network, it appears that these still fail on android-pie-x86-rel which apparently does have network access. Will investigate further but rolling this back for now.

Original change's description:
> Add network restriction for translate tests so we can reenable them.
>
> These tests were failing on networkless phones in lab. We should probably figure out how to mock out the translate service for these, but for now this is a step in the right direction.
>
> Bug: 1130712
> Bug: 1127786
>
> Change-Id: Ifd7cb1176ae9beb89c1f44268af9c0add9f29a99
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446894
> Commit-Queue: Josh Simmons <jds@google.com>
> Reviewed-by: Scott Little <sclittle@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#813456}

TBR=sclittle@chromium.org,jds@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1130712
Bug: 1127786
Change-Id: Ib2809b0bcf973c841bd1cbb661a5fcd44a71500b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450729Reviewed-by: default avatarScott Little <sclittle@chromium.org>
Commit-Queue: Josh Simmons <jds@google.com>
Cr-Commit-Position: refs/heads/master@{#813850}
parent 20e93c20
...@@ -17,6 +17,7 @@ import org.junit.Test; ...@@ -17,6 +17,7 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.R; import org.chromium.chrome.R;
...@@ -72,11 +73,9 @@ public class TranslateCompactInfoBarTest { ...@@ -72,11 +73,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
// TODO(crbug.com/1134812): Remove the reliance on a network connection for these tests. @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @DisabledTest(message = "https://crbug.com/1130712")
Restriction.RESTRICTION_TYPE_INTERNET}) public void testTranslateCompactInfoBarAppears() throws TimeoutException {
public void
testTranslateCompactInfoBarAppears() throws TimeoutException {
mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE));
mListener.addInfoBarAnimationFinished("InfoBar not opened."); mListener.addInfoBarAnimationFinished("InfoBar not opened.");
InfoBar infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0); InfoBar infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0);
...@@ -90,10 +89,9 @@ public class TranslateCompactInfoBarTest { ...@@ -90,10 +89,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
Restriction.RESTRICTION_TYPE_INTERNET}) @DisabledTest(message = "https://crbug.com/1130712")
public void public void testTranslateCompactInfoBarOverflowMenus() throws TimeoutException {
testTranslateCompactInfoBarOverflowMenus() throws TimeoutException {
mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE));
mListener.addInfoBarAnimationFinished("InfoBar not opened."); mListener.addInfoBarAnimationFinished("InfoBar not opened.");
TranslateCompactInfoBar infoBar = TranslateCompactInfoBar infoBar =
...@@ -114,10 +112,9 @@ public class TranslateCompactInfoBarTest { ...@@ -114,10 +112,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
Restriction.RESTRICTION_TYPE_INTERNET}) @DisabledTest(message = "https://crbug.com/1130712")
public void public void testTabMenuDismissedOnOrientationChange() throws Exception {
testTabMenuDismissedOnOrientationChange() throws Exception {
mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE));
mListener.addInfoBarAnimationFinished("InfoBar not opened."); mListener.addInfoBarAnimationFinished("InfoBar not opened.");
TranslateCompactInfoBar infoBar = TranslateCompactInfoBar infoBar =
...@@ -145,10 +142,9 @@ public class TranslateCompactInfoBarTest { ...@@ -145,10 +142,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
Restriction.RESTRICTION_TYPE_INTERNET}) @DisabledTest(message = "https://crbug.com/1130712")
public void public void testTranslateCompactInfoBarReopenOnTarget() throws TimeoutException {
testTranslateCompactInfoBarReopenOnTarget() throws TimeoutException {
mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE));
mListener.addInfoBarAnimationFinished("InfoBar not opened."); mListener.addInfoBarAnimationFinished("InfoBar not opened.");
...@@ -181,10 +177,9 @@ public class TranslateCompactInfoBarTest { ...@@ -181,10 +177,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
Restriction.RESTRICTION_TYPE_INTERNET}) @DisabledTest(message = "https://crbug.com/1130712")
public void public void testStartTranslateOnManualInitiation() throws TimeoutException {
testStartTranslateOnManualInitiation() throws TimeoutException {
// Load a page that won't trigger the translate recommendation. // Load a page that won't trigger the translate recommendation.
mActivityTestRule.loadUrl(mTestServer.getURL(NON_TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(NON_TRANSLATE_PAGE));
...@@ -209,10 +204,9 @@ public class TranslateCompactInfoBarTest { ...@@ -209,10 +204,9 @@ public class TranslateCompactInfoBarTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Browser", "Main"}) @Feature({"Browser", "Main"})
@Restriction({ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES, @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES)
Restriction.RESTRICTION_TYPE_INTERNET}) @DisabledTest(message = "https://crbug.com/1130712")
public void public void testManualInitiationWithBarOpen() throws TimeoutException {
testManualInitiationWithBarOpen() throws TimeoutException {
mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); mActivityTestRule.loadUrl(mTestServer.getURL(TRANSLATE_PAGE));
mListener.addInfoBarAnimationFinished("InfoBar not opened."); mListener.addInfoBarAnimationFinished("InfoBar not opened.");
......
...@@ -8,6 +8,7 @@ import android.content.ComponentName; ...@@ -8,6 +8,7 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Build.VERSION_CODES;
import androidx.test.filters.MediumTest; import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest; import androidx.test.filters.SmallTest;
...@@ -24,7 +25,7 @@ import org.junit.runner.RunWith; ...@@ -24,7 +25,7 @@ import org.junit.runner.RunWith;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.DisableIf;
import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
...@@ -135,10 +136,12 @@ public class TranslateIntentTest { ...@@ -135,10 +136,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
// TODO(crbug.com/1134812): Remove the reliance on a network connection for these tests. @DisableIf.
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.DisableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.DisableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentDisabled() throws TimeoutException { public void
testTranslateIntentDisabled() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -153,9 +156,12 @@ public class TranslateIntentTest { ...@@ -153,9 +156,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentOnTranslatePage() throws TimeoutException { public void
testTranslateIntentOnTranslatePage() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -170,9 +176,12 @@ public class TranslateIntentTest { ...@@ -170,9 +176,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentOnNonTranslatePage() throws TimeoutException { public void
testTranslateIntentOnNonTranslatePage() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE);
// Load a page that doesn't trigger the translate recommendation. // Load a page that doesn't trigger the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -189,10 +198,12 @@ public class TranslateIntentTest { ...@@ -189,10 +198,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentWithTargetLanguage() public void
throws TimeoutException, ExecutionException { testTranslateIntentWithTargetLanguage() throws TimeoutException, ExecutionException {
final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE);
// Load a page that doesn't trigger the translate recommendation. // Load a page that doesn't trigger the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -218,9 +229,12 @@ public class TranslateIntentTest { ...@@ -218,9 +229,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentWithUnsupportedTargetLanguage() throws TimeoutException { public void
testTranslateIntentWithUnsupportedTargetLanguage() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(NON_TRANSLATE_PAGE);
// Load a page that doesn't trigger the translate recommendation. // Load a page that doesn't trigger the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -235,9 +249,12 @@ public class TranslateIntentTest { ...@@ -235,9 +249,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentOnIncognito() throws TimeoutException { public void
testTranslateIntentOnIncognito() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrlInNewTab(url, /*incognito=*/true); sActivityTestRule.loadUrlInNewTab(url, /*incognito=*/true);
...@@ -256,9 +273,12 @@ public class TranslateIntentTest { ...@@ -256,9 +273,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentWithUrlMismatch() throws TimeoutException { public void
testTranslateIntentWithUrlMismatch() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -273,9 +293,12 @@ public class TranslateIntentTest { ...@@ -273,9 +293,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentWithoutExpectedUrl() throws TimeoutException { public void
testTranslateIntentWithoutExpectedUrl() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -290,9 +313,12 @@ public class TranslateIntentTest { ...@@ -290,9 +313,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentVerifyComponent() throws TimeoutException { public void
testTranslateIntentVerifyComponent() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
...@@ -313,9 +339,12 @@ public class TranslateIntentTest { ...@@ -313,9 +339,12 @@ public class TranslateIntentTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(Restriction.RESTRICTION_TYPE_INTERNET) @DisableIf.
Build(sdk_is_greater_than = VERSION_CODES.LOLLIPOP_MR1, sdk_is_less_than = VERSION_CODES.N,
message = "Consistently failing on Marshmallow https://crbug.com/1127786")
@Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT}) @Features.EnableFeatures({ChromeFeatureList.TRANSLATE_INTENT})
public void testTranslateIntentIncorrectComponent() throws TimeoutException { public void
testTranslateIntentIncorrectComponent() throws TimeoutException {
final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE); final String url = sActivityTestRule.getTestServer().getURL(TRANSLATE_PAGE);
// Load a page that triggers the translate recommendation. // Load a page that triggers the translate recommendation.
sActivityTestRule.loadUrl(url); sActivityTestRule.loadUrl(url);
......
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