New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 746436 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Can't disable features in instrumentation tests from command line flags

Project Member Reported by dgn@chromium.org, Jul 19 2017

Issue description

From https://chromium-review.googlesource.com/c/576029/


    @Test
    @SmallTest
    @CommandLineFlags.Add("--disable-features=NTPArticleSuggestions")
    public void testRemoteSuggestionsEnabledWhenFeatureDisabled() {
        Assert.assertFalse(ChromeFeatureList.isEnabled("NTPArticleSuggestions"));  // <- Fails
        Assert.assertFalse(
                mNtp.getManagerForTesting().getSuggestionsSource().areRemoteSuggestionsEnabled());
    }
 
Status: WontFix (was: Available)
I think you would want to use that w/o the leading "--", i.e.

@CommandLineFlags.Add("disable-features=NTPArticleSuggestions")

e.g. https://codesearch.chromium.org/search/?q=CommandLineFlags.Add%5C(%5C%22disable-features&sq=package:chromium&type=cs

Comment 2 by dgn@chromium.org, Jul 19 2017

/facepalm thanks that works.

But that means that we have flags that have no effect then, right?

This is sprinkled all over the place
    @CommandLineFlags.Add({
        ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
        ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG,
    })

The network one is defined as 

    public static final String DISABLE_NETWORK_PREDICTION_FLAG =
            "--disable-features=NetworkPrediction";
... hm, yeah, that's a bug :/

Sign in to add a comment