Commit 18c7d262 authored by Mei Liang's avatar Mei Liang Committed by Chromium LUCI CQ

[Instant Start] Disable Instant Start in Svelte

Bug: 1153604
Change-Id: I7e61b9da34f239c53a902aba8473d690dcaeeecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2580403Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Reviewed-by: default avatarYue Zhang <yuezhanggg@chromium.org>
Commit-Queue: Mei Liang <meiliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835322}
parent c220e268
...@@ -52,11 +52,13 @@ import org.junit.Test; ...@@ -52,11 +52,13 @@ import org.junit.Test;
import org.junit.rules.ErrorCollector; import org.junit.rules.ErrorCollector;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.BaseSwitches;
import org.chromium.base.BuildConfig; import org.chromium.base.BuildConfig;
import org.chromium.base.Callback; import org.chromium.base.Callback;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.NativeLibraryLoadedStatus; import org.chromium.base.NativeLibraryLoadedStatus;
import org.chromium.base.StreamUtil; import org.chromium.base.StreamUtil;
import org.chromium.base.SysUtils;
import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.test.params.ParameterAnnotations; import org.chromium.base.test.params.ParameterAnnotations;
import org.chromium.base.test.params.ParameterProvider; import org.chromium.base.test.params.ParameterProvider;
...@@ -933,6 +935,25 @@ public class InstantStartTest { ...@@ -933,6 +935,25 @@ public class InstantStartTest {
Assert.assertEquals(123, ((StaticLayout) activeLayout).getCurrentTabIdForTesting()); Assert.assertEquals(123, ((StaticLayout) activeLayout).getCurrentTabIdForTesting());
} }
@Test
@SmallTest
@CommandLineFlags.Add(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE)
@Features.EnableFeatures({ChromeFeatureList.TAB_GROUPS_ANDROID,
ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID})
// clang-format off
public void testInstantStartDisabledOnLowEndDevice() throws IOException {
// clang-format on
createTabStateFile(new int[] {123});
mActivityTestRule.startMainActivityFromLauncher();
// SysUtils.resetForTesting is required here due to the test restriction setup. With the
// RESTRICTION_TYPE_NON_LOW_END_DEVICE restriction on the class, SysUtils#detectLowEndDevice
// is called before the BaseSwitches.ENABLE_LOW_END_DEVICE_MODE is applied. Reset here to
// make sure BaseSwitches.ENABLE_LOW_END_DEVICE_MODE can be applied.
SysUtils.resetForTesting();
Assert.assertFalse(TabUiFeatureUtilities.supportInstantStart(false));
}
@Test @Test
@SmallTest @SmallTest
@Restriction({UiRestriction.RESTRICTION_TYPE_PHONE}) @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE})
......
...@@ -186,7 +186,8 @@ public class TabUiFeatureUtilities { ...@@ -186,7 +186,8 @@ public class TabUiFeatureUtilities {
*/ */
public static boolean supportInstantStart(boolean isTablet) { public static boolean supportInstantStart(boolean isTablet) {
return !DeviceClassManager.enableAccessibilityLayout() return !DeviceClassManager.enableAccessibilityLayout()
&& CachedFeatureFlags.isEnabled(ChromeFeatureList.INSTANT_START) && !isTablet; && CachedFeatureFlags.isEnabled(ChromeFeatureList.INSTANT_START) && !isTablet
&& !SysUtils.isLowEndDevice();
} }
/** /**
......
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