Commit 917b7fd2 authored by spdonghao's avatar spdonghao Committed by Commit Bot

Replace CachedFeatureFlags.setForTesting() with @Features annotation in non-MTM tests

Bug: 1058829
Change-Id: Idfe84e89c5c390e5102e9d4e78c52fbf4c19fc7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090207
Commit-Queue: Hao Dong <spdonghao@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749495}
parent 6ad940a1
...@@ -18,6 +18,7 @@ import org.junit.Assert; ...@@ -18,6 +18,7 @@ import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
...@@ -27,9 +28,9 @@ import org.chromium.base.test.util.Feature; ...@@ -27,9 +28,9 @@ import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure; import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.base.test.util.UrlUtils; import org.chromium.base.test.util.UrlUtils;
import org.chromium.chrome.browser.download.DownloadManagerServiceTest.MockDownloadNotifier.MethodID; import org.chromium.chrome.browser.download.DownloadManagerServiceTest.MockDownloadNotifier.MethodID;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.test.ChromeBrowserTestRule; import org.chromium.chrome.test.ChromeBrowserTestRule;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.ContentId;
import org.chromium.components.offline_items_collection.OfflineItem.Progress; import org.chromium.components.offline_items_collection.OfflineItem.Progress;
import org.chromium.components.offline_items_collection.OfflineItemProgressUnit; import org.chromium.components.offline_items_collection.OfflineItemProgressUnit;
...@@ -54,7 +55,8 @@ import java.util.concurrent.ConcurrentLinkedQueue; ...@@ -54,7 +55,8 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class DownloadManagerServiceTest { public class DownloadManagerServiceTest {
@Rule @Rule
public final ChromeBrowserTestRule mBrowserTestRule = new ChromeBrowserTestRule(); public final ChromeBrowserTestRule mBrowserTestRule = new ChromeBrowserTestRule();
@Rule
public TestRule mProcessor = new Features.InstrumentationProcessor();
private static final int UPDATE_DELAY_FOR_TEST = 1; private static final int UPDATE_DELAY_FOR_TEST = 1;
private static final int DELAY_BETWEEN_CALLS = 10; private static final int DELAY_BETWEEN_CALLS = 10;
private static final int LONG_UPDATE_DELAY_FOR_TEST = 500; private static final int LONG_UPDATE_DELAY_FOR_TEST = 500;
...@@ -438,9 +440,8 @@ public class DownloadManagerServiceTest { ...@@ -438,9 +440,8 @@ public class DownloadManagerServiceTest {
@MediumTest @MediumTest
@Feature({"Download"}) @Feature({"Download"})
@RetryOnFailure @RetryOnFailure
@Features.DisableFeatures({ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE})
public void testInterruptedDownloadAreAutoResumed() throws InterruptedException { public void testInterruptedDownloadAreAutoResumed() throws InterruptedException {
CachedFeatureFlags.setForTesting(ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE, false);
MockDownloadNotifier notifier = new MockDownloadNotifier(); MockDownloadNotifier notifier = new MockDownloadNotifier();
createDownloadManagerService(notifier, UPDATE_DELAY_FOR_TEST); createDownloadManagerService(notifier, UPDATE_DELAY_FOR_TEST);
DownloadManagerService.disableNetworkListenerForTest(); DownloadManagerService.disableNetworkListenerForTest();
......
...@@ -24,7 +24,6 @@ import org.chromium.base.metrics.RecordHistogram; ...@@ -24,7 +24,6 @@ import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.partnercustomizations.HomepageManager; import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
...@@ -82,8 +81,6 @@ public class HomepagePolicyIntegrationTest { ...@@ -82,8 +81,6 @@ public class HomepagePolicyIntegrationTest {
@Before @Before
public void setUp() { public void setUp() {
// Disable Histogram for tests.
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, true);
// Give some user pref setting, simulate user that have their customized preference. // Give some user pref setting, simulate user that have their customized preference.
// Use shared preference manager, not to change the order object created in tests. // Use shared preference manager, not to change the order object created in tests.
...@@ -98,7 +95,6 @@ public class HomepagePolicyIntegrationTest { ...@@ -98,7 +95,6 @@ public class HomepagePolicyIntegrationTest {
@After @After
public void tearDown() { public void tearDown() {
mTestServer.stopAndDestroyServer(); mTestServer.stopAndDestroyServer();
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, null);
} }
@Test @Test
......
...@@ -22,7 +22,6 @@ import org.chromium.base.test.util.Feature; ...@@ -22,7 +22,6 @@ 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;
import org.chromium.chrome.browser.compositor.layouts.OverviewModeState; import org.chromium.chrome.browser.compositor.layouts.OverviewModeState;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
...@@ -36,7 +35,8 @@ import org.chromium.ui.test.util.UiRestriction; ...@@ -36,7 +35,8 @@ import org.chromium.ui.test.util.UiRestriction;
/** Tests {@link ShareButtonController}. */ /** Tests {@link ShareButtonController}. */
@RunWith(ChromeJUnit4ClassRunner.class) @RunWith(ChromeJUnit4ClassRunner.class)
@EnableFeatures({ChromeFeatureList.SHARE_BUTTON_IN_TOP_TOOLBAR}) @EnableFeatures(
{ChromeFeatureList.SHARE_BUTTON_IN_TOP_TOOLBAR, ChromeFeatureList.START_SURFACE_ANDROID})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=" + ChromeFeatureList.START_SURFACE_ANDROID + "<Study", "enable-features=" + ChromeFeatureList.START_SURFACE_ANDROID + "<Study",
"force-fieldtrials=Study/Group"}) "force-fieldtrials=Study/Group"})
...@@ -46,8 +46,6 @@ public final class ShareButtonControllerTest { ...@@ -46,8 +46,6 @@ public final class ShareButtonControllerTest {
@Before @Before
public void setUp() { public void setUp() {
CachedFeatureFlags.setForTesting(ChromeFeatureList.START_SURFACE_ANDROID, true);
CachedFeatureFlags.setForTesting(ChromeFeatureList.SHARE_BUTTON_IN_TOP_TOOLBAR, true);
SigninTestUtil.setUpAuthForTest(); SigninTestUtil.setUpAuthForTest();
mActivityTestRule.startMainActivityOnBlankPage(); mActivityTestRule.startMainActivityOnBlankPage();
} }
......
...@@ -17,9 +17,7 @@ import android.support.test.filters.MediumTest; ...@@ -17,9 +17,7 @@ import android.support.test.filters.MediumTest;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -27,13 +25,13 @@ import org.junit.runner.RunWith; ...@@ -27,13 +25,13 @@ 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.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager.Variations; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager.Variations;
import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.OverviewModeBehaviorWatcher; import org.chromium.chrome.test.util.OverviewModeBehaviorWatcher;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.UiRestriction; import org.chromium.ui.test.util.UiRestriction;
...@@ -43,22 +41,16 @@ import java.util.concurrent.ExecutionException; ...@@ -43,22 +41,16 @@ import java.util.concurrent.ExecutionException;
* Integration tests for the bottom toolbar. * Integration tests for the bottom toolbar.
*/ */
@RunWith(ChromeJUnit4ClassRunner.class) @RunWith(ChromeJUnit4ClassRunner.class)
// clang-format off
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
@Features.EnableFeatures({ChromeFeatureList.CHROME_DUET})
public class BottomToolbarTest { public class BottomToolbarTest {
//clang-format on
@Rule @Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class); new ChromeActivityTestRule<>(ChromeActivity.class);
@Before
public void setUp() throws InterruptedException {
CachedFeatureFlags.setForTesting(ChromeFeatureList.CHROME_DUET, true);
}
@After
public void tearDown() {
CachedFeatureFlags.setForTesting(ChromeFeatureList.CHROME_DUET, null);
}
@Test @Test
@MediumTest @MediumTest
......
...@@ -9,7 +9,6 @@ import static org.chromium.chrome.test.util.ToolbarTestUtils.checkToolbarVisibil ...@@ -9,7 +9,6 @@ import static org.chromium.chrome.test.util.ToolbarTestUtils.checkToolbarVisibil
import android.support.test.filters.MediumTest; import android.support.test.filters.MediumTest;
import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
...@@ -18,12 +17,12 @@ import org.junit.runner.RunWith; ...@@ -18,12 +17,12 @@ 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.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.browser.compositor.layouts.OverviewModeState; import org.chromium.chrome.browser.compositor.layouts.OverviewModeState;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager.Variations; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager.Variations;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.chrome.test.util.browser.FieldTrials; import org.chromium.chrome.test.util.browser.FieldTrials;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.UiRestriction; import org.chromium.ui.test.util.UiRestriction;
...@@ -32,12 +31,15 @@ import org.chromium.ui.test.util.UiRestriction; ...@@ -32,12 +31,15 @@ import org.chromium.ui.test.util.UiRestriction;
* Test bottom toolbar when start surface is enabled. * Test bottom toolbar when start surface is enabled.
*/ */
@RunWith(ChromeJUnit4ClassRunner.class) @RunWith(ChromeJUnit4ClassRunner.class)
// clang-format off
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=" + ChromeFeatureList.START_SURFACE_ANDROID + "<Study", "enable-features=" + ChromeFeatureList.START_SURFACE_ANDROID + "<Study",
"force-fieldtrials=Study/Group", "force-fieldtrials=Study/Group",
"force-fieldtrial-params=Study.Group:start_surface_variation/single"}) "force-fieldtrial-params=Study.Group:start_surface_variation/single"})
@Features.EnableFeatures({ChromeFeatureList.CHROME_DUET, ChromeFeatureList.START_SURFACE_ANDROID})
public class BottomToolbarWithStartSurfaceTest { public class BottomToolbarWithStartSurfaceTest {
//clang-format on
@Rule @Rule
public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
...@@ -45,15 +47,6 @@ public class BottomToolbarWithStartSurfaceTest { ...@@ -45,15 +47,6 @@ public class BottomToolbarWithStartSurfaceTest {
public void setUp() { public void setUp() {
// TODO(https://crbug.com/1060622): Removes this. // TODO(https://crbug.com/1060622): Removes this.
FieldTrials.getInstance().reset(); FieldTrials.getInstance().reset();
CachedFeatureFlags.setForTesting(ChromeFeatureList.CHROME_DUET, true);
CachedFeatureFlags.setForTesting(ChromeFeatureList.START_SURFACE_ANDROID, true);
}
@After
public void tearDown() {
CachedFeatureFlags.setForTesting(ChromeFeatureList.CHROME_DUET, null);
CachedFeatureFlags.setForTesting(ChromeFeatureList.START_SURFACE_ANDROID, null);
} }
private void launchActivity(@Variations String variation) { private void launchActivity(@Variations String variation) {
......
...@@ -19,6 +19,7 @@ import org.junit.After; ...@@ -19,6 +19,7 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.Mock; import org.mockito.Mock;
...@@ -29,8 +30,8 @@ import org.robolectric.annotation.Config; ...@@ -29,8 +30,8 @@ import org.robolectric.annotation.Config;
import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.background_task_scheduler.ChromeBackgroundTaskFactory; import org.chromium.chrome.browser.background_task_scheduler.ChromeBackgroundTaskFactory;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.background_task_scheduler.BackgroundTaskScheduler; import org.chromium.components.background_task_scheduler.BackgroundTaskScheduler;
import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory;
import org.chromium.components.background_task_scheduler.TaskIds; import org.chromium.components.background_task_scheduler.TaskIds;
...@@ -48,6 +49,7 @@ import java.util.concurrent.TimeUnit; ...@@ -48,6 +49,7 @@ import java.util.concurrent.TimeUnit;
*/ */
@RunWith(BaseRobolectricTestRunner.class) @RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE) @Config(manifest = Config.NONE)
@Features.DisableFeatures({ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE})
public class DownloadResumptionSchedulerTest { public class DownloadResumptionSchedulerTest {
@Mock @Mock
private BackgroundTaskScheduler mScheduler; private BackgroundTaskScheduler mScheduler;
...@@ -55,9 +57,11 @@ public class DownloadResumptionSchedulerTest { ...@@ -55,9 +57,11 @@ public class DownloadResumptionSchedulerTest {
@Rule @Rule
public MockitoRule mockitoRule = MockitoJUnit.rule(); public MockitoRule mockitoRule = MockitoJUnit.rule();
@Rule
public TestRule mProcessor = new Features.InstrumentationProcessor();
@Before @Before
public void setUp() { public void setUp() {
CachedFeatureFlags.setForTesting(ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE, false);
BackgroundTaskSchedulerFactory.setSchedulerForTesting(mScheduler); BackgroundTaskSchedulerFactory.setSchedulerForTesting(mScheduler);
ChromeBackgroundTaskFactory.setAsDefault(); ChromeBackgroundTaskFactory.setAsDefault();
} }
......
...@@ -9,7 +9,6 @@ import android.support.test.filters.SmallTest; ...@@ -9,7 +9,6 @@ import android.support.test.filters.SmallTest;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
...@@ -22,7 +21,6 @@ import org.mockito.MockitoAnnotations; ...@@ -22,7 +21,6 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config; import org.robolectric.annotation.Config;
import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.homepage.HomepagePolicyManager.HomepagePolicyStateListener; import org.chromium.chrome.browser.homepage.HomepagePolicyManager.HomepagePolicyStateListener;
import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
...@@ -73,8 +71,6 @@ public class HomepagePolicyManagerTest { ...@@ -73,8 +71,6 @@ public class HomepagePolicyManagerTest {
ChromeBrowserInitializer.setForTesting(mChromeBrowserInitializer); ChromeBrowserInitializer.setForTesting(mChromeBrowserInitializer);
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, true);
// Disable the policy during setup // Disable the policy during setup
PrefServiceBridge.setInstanceForTesting(mMockServiceBridge); PrefServiceBridge.setInstanceForTesting(mMockServiceBridge);
setupNewHomepagePolicyManagerForTests(false, "", null); setupNewHomepagePolicyManagerForTests(false, "", null);
...@@ -84,12 +80,6 @@ public class HomepagePolicyManagerTest { ...@@ -84,12 +80,6 @@ public class HomepagePolicyManagerTest {
mHomepagePolicyManager.isHomepageLocationPolicyEnabled()); mHomepagePolicyManager.isHomepageLocationPolicyEnabled());
} }
@After
public void tearDown() {
// Empty cache inside the {@link CachedFeatureFlags}.
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, null);
}
/** /**
* Set up the homepage location for Mock PrefServiceBridge, and create HomepagePolicyManager * Set up the homepage location for Mock PrefServiceBridge, and create HomepagePolicyManager
* instance. * instance.
...@@ -272,7 +262,6 @@ public class HomepagePolicyManagerTest { ...@@ -272,7 +262,6 @@ public class HomepagePolicyManagerTest {
public void testFeatureFlagDisabled() { public void testFeatureFlagDisabled() {
Mockito.reset(mMockRegistrar); Mockito.reset(mMockRegistrar);
Mockito.reset(mMockServiceBridge); Mockito.reset(mMockServiceBridge);
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, false);
// 1. Test initialization early finishing // 1. Test initialization early finishing
setupNewHomepagePolicyManagerForTests(true, TEST_URL, null); setupNewHomepagePolicyManagerForTests(true, TEST_URL, null);
...@@ -299,7 +288,6 @@ public class HomepagePolicyManagerTest { ...@@ -299,7 +288,6 @@ public class HomepagePolicyManagerTest {
@SmallTest @SmallTest
@DisableFeatures(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY) @DisableFeatures(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY)
public void testIllegal_Refresh() { public void testIllegal_Refresh() {
CachedFeatureFlags.setForTesting(ChromeFeatureList.HOMEPAGE_LOCATION_POLICY, false);
TestThreadUtils.runOnUiThreadBlocking( TestThreadUtils.runOnUiThreadBlocking(
() -> { mHomepagePolicyManager.onPreferenceChange(); }); () -> { mHomepagePolicyManager.onPreferenceChange(); });
} }
......
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