Files
Flexera-Launcher/robolectric_tests/src/com/android/launcher3/config/FlagOverrideSampleTest.java
T
Hyunyoung Song deb7cd54e7 Remove FeatureFlags.STYLE_WALLPAPERS
Bug: 129874298
Change-Id: I2785f1e49a4ff60143cc763c3dac0c1bb33b41c8
2019-04-09 17:22:30 +00:00

38 lines
1.0 KiB
Java

package com.android.launcher3.config;
import com.android.launcher3.config.FlagOverrideRule.FlagOverride;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Sample Robolectric test that demonstrates flag-overriding.
*/
@RunWith(RobolectricTestRunner.class)
public class FlagOverrideSampleTest {
// Check out https://junit.org/junit4/javadoc/4.12/org/junit/Rule.html for more information
// on @Rules.
@Rule
public final FlagOverrideRule flags = new FlagOverrideRule();
@FlagOverride(key = "EXAMPLE_FLAG", value = true)
@FlagOverride(key = "QUICK_SWITCH", value = false)
@Test
public void withFlagOn() {
assertTrue(FeatureFlags.EXAMPLE_FLAG.get());
}
@FlagOverride(key = "EXAMPLE_FLAG", value = false)
@Test
public void withFlagOff() {
assertFalse(FeatureFlags.EXAMPLE_FLAG.get());
}
}