[Hub] Disable Hub for some tests where is should be off
These tests are incompatible with Hub being enabled. Mostly because
Hub has a different toolbar.
Hub uses a cached flag these were found by forcing the flag on in a
testonly CL in preparation for landing a fieldtrial config update.
https://chromium-review.googlesource.com/c/chromium/src/+/5211686
Bug: b/321005166
Change-Id: Ib66f6b90e81d2e7336e2d1dd0dd754d97cc60d7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5213706
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Auto-Submit: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249119}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/AdaptiveToolbarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/AdaptiveToolbarTest.java
index eb18db2b5..87f9d6e 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/AdaptiveToolbarTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/AdaptiveToolbarTest.java
@@ -39,7 +39,7 @@
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
-@DisableFeatures({ChromeFeatureList.START_SURFACE_ANDROID})
+@DisableFeatures({ChromeFeatureList.START_SURFACE_ANDROID, ChromeFeatureList.ANDROID_HUB})
public class AdaptiveToolbarTest {
@Rule
public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherActionMenuPTTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherActionMenuPTTest.java
index 6fc3116..5762a29 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherActionMenuPTTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherActionMenuPTTest.java
@@ -17,7 +17,9 @@
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.Features.DisableFeatures;
import org.chromium.base.test.util.Restriction;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
@@ -39,6 +41,7 @@
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
+@DisableFeatures(ChromeFeatureList.ANDROID_HUB)
public class TabSwitcherActionMenuPTTest {
@Rule
public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java
index 38f01e3..3ab2c24 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java
@@ -480,6 +480,7 @@
@Test
@MediumTest
@EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION})
+ @DisableFeatures({ChromeFeatureList.ANDROID_HUB})
public void testEnterTabSwitcher_toolbarVisibleUntilTransitionEnds_startSurfaceEnabled() {
ChromeTabbedActivity cta = mActivityTestRule.getActivity();
TabModelSelector tabModelSelector = cta.getTabModelSelectorSupplier().get();
@@ -517,6 +518,7 @@
@Test
@MediumTest
@EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION})
+ @DisableFeatures({ChromeFeatureList.ANDROID_HUB})
@DisableAnimationsTestRule.EnsureAnimationsOn
public void
testEnterTabSwitcher_toolbarVisibleUntilTransitionEnds_startSurfaceEnabled_animationsEnabled() {
@@ -564,7 +566,7 @@
@Test
@MediumTest
- @DisableFeatures(ChromeFeatureList.START_SURFACE_ANDROID)
+ @DisableFeatures({ChromeFeatureList.START_SURFACE_ANDROID, ChromeFeatureList.ANDROID_HUB})
@DisableAnimationsTestRule.EnsureAnimationsOn
public void testEnterTabSwitcher_toolbarVisibleUntilTransitionEnds_startSurfaceDisabled() {
ChromeTabbedActivity cta = mActivityTestRule.getActivity();
@@ -608,6 +610,7 @@
@Test
@MediumTest
@EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION})
+ @DisableFeatures({ChromeFeatureList.ANDROID_HUB})
@DisableAnimationsTestRule.EnsureAnimationsOn
public void testToolbarTabSwitcherButtonNotClickableDuringTransition_startSurfaceEnabled() {
ChromeTabbedActivity cta = mActivityTestRule.getActivity();
@@ -675,7 +678,7 @@
@Test
@MediumTest
- @DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION)
+ @DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION, ChromeFeatureList.ANDROID_HUB})
@DisableAnimationsTestRule.EnsureAnimationsOn
public void
testToolbarTabSwitcherButtonNotClickableDuringTransition_startSurfaceEnabled_noAnimation() {
@@ -745,7 +748,7 @@
@Test
@MediumTest
@EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION)
- @DisableFeatures(ChromeFeatureList.START_SURFACE_ANDROID)
+ @DisableFeatures({ChromeFeatureList.START_SURFACE_ANDROID, ChromeFeatureList.ANDROID_HUB})
@DisableAnimationsTestRule.EnsureAnimationsOn
public void testToolbarTabSwitcherButtonNotClickableDuringTransition_startSurfaceDisabled() {
ChromeTabbedActivity cta = mActivityTestRule.getActivity();
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/HubFieldTrialTest.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/HubFieldTrialTest.java
index b7c8da0..8275a31 100644
--- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/HubFieldTrialTest.java
+++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/HubFieldTrialTest.java
@@ -32,6 +32,7 @@
@Test
@SmallTest
+ @Features.DisableFeatures({ChromeFeatureList.ANDROID_HUB})
public void testHubDisabled() {
assertFalse(HubFieldTrial.isHubEnabled());
}