Commit 278810ea authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Clean up TabToGTSAnimation testing toggle

This should be no-op in prod code.

Bug: None
Change-Id: I8bd24b4c6d20f9ae461d3e4b4c8e860fd71dee2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117531Reviewed-by: default avatarMei Liang <meiliang@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754831}
parent f3849446
......@@ -8,7 +8,6 @@ import android.os.Build;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
......@@ -72,7 +71,6 @@ public class TabUiFeatureUtilities {
ChromeFeatureList.TAB_TO_GTS_ANIMATION, MIN_MEMORY_MB_PARAM, 2048);
private static Boolean sTabManagementModuleSupportedForTesting;
private static Boolean sIsTabToGtsAnimationEnabled;
/**
* Set whether the tab management module is supported for testing.
......@@ -158,23 +156,10 @@ public class TabUiFeatureUtilities {
return TextUtils.equals(TAB_GRID_LAYOUT_ANDROID_NEW_TAB_TILE.getValue(), "NewTabTile");
}
/**
* Toggles whether the Tab-to-GTS animation is enabled for testing. Should be reset back to
* null after the test has finished.
*/
@VisibleForTesting
public static void setIsTabToGtsAnimationEnabledForTesting(@Nullable Boolean enabled) {
sIsTabToGtsAnimationEnabled = enabled;
}
/**
* @return Whether the Tab-to-Grid (and Grid-to-Tab) transition animation is enabled.
*/
public static boolean isTabToGtsAnimationEnabled() {
if (sIsTabToGtsAnimationEnabled != null) {
Log.d(TAG, "IsTabToGtsAnimationEnabled forced to " + sIsTabToGtsAnimationEnabled);
return sIsTabToGtsAnimationEnabled;
}
Log.d(TAG, "GTS.MinSdkVersion = " + ZOOMING_MIN_SDK.getValue());
Log.d(TAG, "GTS.MinMemoryMB = " + ZOOMING_MIN_MEMORY.getValue());
return CachedFeatureFlags.isEnabled(ChromeFeatureList.TAB_TO_GTS_ANIMATION)
......
......@@ -21,13 +21,13 @@ import android.widget.FrameLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.tab_ui.R;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
......@@ -43,6 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
/**
* Integration tests for TabGridMessageCardProvider component.
*/
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION)
public class MessageCardProviderTest extends DummyUiActivityTestCase {
private static final int SUGGESTED_TAB_COUNT = 2;
......@@ -98,7 +99,6 @@ public class MessageCardProviderTest extends DummyUiActivityTestCase {
public void setUpTest() throws Exception {
super.setUpTest();
MockitoAnnotations.initMocks(this);
TabUiFeatureUtilities.setIsTabToGtsAnimationEnabledForTesting(false);
// TODO(meiliang): Replace with TabSwitcher instead when ready to integrate with
// TabSwitcher.
ViewGroup view = new FrameLayout(getActivity());
......@@ -137,11 +137,6 @@ public class MessageCardProviderTest extends DummyUiActivityTestCase {
mCoordinator.subscribeMessageService(mSuggestionService);
}
@After
public void tearDown() {
TabUiFeatureUtilities.setIsTabToGtsAnimationEnabledForTesting(null);
}
@Test
@SmallTest
public void testShowingTabSuggestionMessage() {
......
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