[Android]Renames kBraveFreshNtpAfterIdleExpirementVariant to kBraveFreshNtpAfterIdleExperimentVariant (#32499)
[Android]Renames kBraveFreshNtpAfterIdleExpirementVariant to kBraveFreshNtpAfterIdleExperimentVariant. Resolves: https://github.com/brave/brave-browser/issues/51045
This commit is contained in:
@@ -35,8 +35,8 @@ public abstract class BraveFeatureList {
|
||||
"BraveShowStrictFingerprintingMode";
|
||||
public static final String BRAVE_DAY_ZERO_EXPERIMENT = "BraveDayZeroExperiment";
|
||||
public static final String BRAVE_NEW_ANDROID_ONBOARDING = "NewAndroidOnboarding";
|
||||
public static final String BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT =
|
||||
"BraveFreshNtpAfterIdleExpirement";
|
||||
public static final String BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT =
|
||||
"BraveFreshNtpAfterIdleExperiment";
|
||||
public static final String BRAVE_FALLBACK_DOH_PROVIDER = "BraveFallbackDoHProvider";
|
||||
public static final String BRAVE_BLOCK_ALL_COOKIES_TOGGLE = "BlockAllCookiesToggle";
|
||||
public static final String BRAVE_SHIELDS_ELEMENT_PICKER = "BraveShieldsElementPicker";
|
||||
|
||||
@@ -20,26 +20,26 @@ import java.util.List;
|
||||
public class BraveCachedFlags extends ChromeCachedFlags {
|
||||
// Cached feature flag for fresh NTP after idle expiration - safe to access before native is
|
||||
// ready
|
||||
public static final CachedFlag sBraveFreshNtpAfterIdleExpirementEnabled =
|
||||
public static final CachedFlag sBraveFreshNtpAfterIdleExperimentEnabled =
|
||||
new CachedFlag(
|
||||
ChromeFeatureMap.getInstance(),
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT,
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT,
|
||||
false);
|
||||
|
||||
// Cached variant parameter for fresh NTP experiment - safe to access before native is ready
|
||||
public static final StringCachedFeatureParam sBraveFreshNtpAfterIdleExpirementVariant =
|
||||
public static final StringCachedFeatureParam sBraveFreshNtpAfterIdleExperimentVariant =
|
||||
new StringCachedFeatureParam(
|
||||
ChromeFeatureMap.getInstance(),
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT,
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT,
|
||||
"variant",
|
||||
"A");
|
||||
|
||||
// List of cached flags for Brave features - safe to access before native is ready
|
||||
private static final List<CachedFlag> sBraveFlagsCached =
|
||||
List.of(sBraveFreshNtpAfterIdleExpirementEnabled);
|
||||
List.of(sBraveFreshNtpAfterIdleExperimentEnabled);
|
||||
// List of cached feature params for Brave features - safe to access before native is ready
|
||||
private static final List<CachedFeatureParam<?>> sBraveFeatureParamsCached =
|
||||
List.of(sBraveFreshNtpAfterIdleExpirementVariant);
|
||||
List.of(sBraveFreshNtpAfterIdleExperimentVariant);
|
||||
|
||||
BraveCachedFlags() {
|
||||
BraveCachedFeatureParam.setBraveParams(sBraveFeatureParamsCached);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class BraveFreshNtpHelper {
|
||||
* flag, so it's safe to call even before native is ready.
|
||||
*/
|
||||
public static boolean isEnabled() {
|
||||
return BraveCachedFlags.sBraveFreshNtpAfterIdleExpirementEnabled.isEnabled();
|
||||
return BraveCachedFlags.sBraveFreshNtpAfterIdleExperimentEnabled.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,6 +31,6 @@ public class BraveFreshNtpHelper {
|
||||
* @return The variant string.
|
||||
*/
|
||||
public static String getVariant() {
|
||||
return BraveCachedFlags.sBraveFreshNtpAfterIdleExpirementVariant.getValue();
|
||||
return BraveCachedFlags.sBraveFreshNtpAfterIdleExperimentVariant.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -49,12 +49,12 @@ public class BackgroundImagesPreferencesTest {
|
||||
// Test for Opening Screen preference when feature is disabled. It should not be shown.
|
||||
@Test
|
||||
@SmallTest
|
||||
@DisableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT)
|
||||
@DisableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT)
|
||||
public void testOpeningScreenPrefNotShownWhenFeatureDisabled() {
|
||||
Assert.assertFalse(
|
||||
"BraveFreshNtpAfterIdleExpirement feature should be disabled",
|
||||
"BraveFreshNtpAfterIdleExperiment feature should be disabled",
|
||||
ChromeFeatureList.isEnabled(
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT));
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT));
|
||||
startSettings();
|
||||
|
||||
// Wait for async preference updates to complete
|
||||
@@ -94,12 +94,12 @@ public class BackgroundImagesPreferencesTest {
|
||||
// The preference should not be shown when variant is "A" (the default).
|
||||
@Test
|
||||
@SmallTest
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT)
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT)
|
||||
public void testOpeningScreenPrefNotShownWhenFeatureEnabledButVariantIsA() {
|
||||
Assert.assertTrue(
|
||||
"BraveFreshNtpAfterIdleExpirement feature should be enabled",
|
||||
"BraveFreshNtpAfterIdleExperiment feature should be enabled",
|
||||
ChromeFeatureList.isEnabled(
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT));
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT));
|
||||
startSettings();
|
||||
|
||||
// Wait for async preference updates to complete
|
||||
@@ -140,12 +140,12 @@ public class BackgroundImagesPreferencesTest {
|
||||
// The preference should be shown when variant is not "A".
|
||||
@Test
|
||||
@SmallTest
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT + ":variant/B")
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT + ":variant/B")
|
||||
public void testOpeningScreenPrefShownWhenFeatureEnabledAndVariantIsB() {
|
||||
Assert.assertTrue(
|
||||
"BraveFreshNtpAfterIdleExpirement feature should be enabled",
|
||||
"BraveFreshNtpAfterIdleExperiment feature should be enabled",
|
||||
ChromeFeatureList.isEnabled(
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT));
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT));
|
||||
startSettings();
|
||||
|
||||
// Wait for async preference updates to complete
|
||||
@@ -187,12 +187,12 @@ public class BackgroundImagesPreferencesTest {
|
||||
// The preference should be shown when variant is not "A".
|
||||
@Test
|
||||
@SmallTest
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT + ":variant/C")
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT + ":variant/C")
|
||||
public void testOpeningScreenPrefShownWhenFeatureEnabledAndVariantIsC() {
|
||||
Assert.assertTrue(
|
||||
"BraveFreshNtpAfterIdleExpirement feature should be enabled",
|
||||
"BraveFreshNtpAfterIdleExperiment feature should be enabled",
|
||||
ChromeFeatureList.isEnabled(
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT));
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT));
|
||||
startSettings();
|
||||
|
||||
// Wait for async preference updates to complete
|
||||
@@ -234,12 +234,12 @@ public class BackgroundImagesPreferencesTest {
|
||||
// The preference should be shown when variant is not "A".
|
||||
@Test
|
||||
@SmallTest
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT + ":variant/D")
|
||||
@EnableFeatures(BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT + ":variant/D")
|
||||
public void testOpeningScreenPrefShownWhenFeatureEnabledAndVariantIsD() {
|
||||
Assert.assertTrue(
|
||||
"BraveFreshNtpAfterIdleExpirement feature should be enabled",
|
||||
"BraveFreshNtpAfterIdleExperiment feature should be enabled",
|
||||
ChromeFeatureList.isEnabled(
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPIREMENT));
|
||||
BraveFeatureList.BRAVE_FRESH_NTP_AFTER_IDLE_EXPERIMENT));
|
||||
startSettings();
|
||||
|
||||
// Wait for async preference updates to complete
|
||||
|
||||
@@ -66,7 +66,7 @@ BASE_FEATURE(kBraveAndroidDynamicColors,
|
||||
// Enable fresh NTP display after idle expiration on Android.
|
||||
// This feature allows showing a refreshed NTP when the app has been idle
|
||||
// for a specified duration.
|
||||
BASE_FEATURE(kBraveFreshNtpAfterIdleExpirement,
|
||||
BASE_FEATURE(kBraveFreshNtpAfterIdleExperiment,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -78,8 +78,8 @@ const base::FeatureParam<std::string> kBraveDayZeroExperimentVariant{
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// The variant of the fresh NTP experiment. i.e. A, B, C, etc.
|
||||
const base::FeatureParam<std::string> kBraveFreshNtpAfterIdleExpirementVariant{
|
||||
&kBraveFreshNtpAfterIdleExpirement,
|
||||
const base::FeatureParam<std::string> kBraveFreshNtpAfterIdleExperimentVariant{
|
||||
&kBraveFreshNtpAfterIdleExperiment,
|
||||
/*name=*/"variant",
|
||||
/*default_value=*/"A"};
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -27,14 +27,14 @@ BASE_DECLARE_FEATURE(kBraveV8JitlessMode);
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
BASE_DECLARE_FEATURE(kBraveAndroidDynamicColors);
|
||||
BASE_DECLARE_FEATURE(kNewAndroidOnboarding);
|
||||
BASE_DECLARE_FEATURE(kBraveFreshNtpAfterIdleExpirement);
|
||||
BASE_DECLARE_FEATURE(kBraveFreshNtpAfterIdleExperiment);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
extern const base::FeatureParam<std::string> kBraveDayZeroExperimentVariant;
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
extern const base::FeatureParam<std::string>
|
||||
kBraveFreshNtpAfterIdleExpirementVariant;
|
||||
kBraveFreshNtpAfterIdleExperimentVariant;
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
} // namespace features
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
&brave_shields::features::kBraveShieldsElementPicker, \
|
||||
&features::kBraveAndroidDynamicColors, \
|
||||
&features::kNewAndroidOnboarding, \
|
||||
&features::kBraveFreshNtpAfterIdleExpirement, \
|
||||
&features::kBraveFreshNtpAfterIdleExperiment, \
|
||||
&brave_ads::kNewTabPageAdFeature, \
|
||||
&ntp_background_images::features::kBraveNTPBrandedWallpaperSurveyPanelist, \
|
||||
&brave_account::features::kBraveAccount, \
|
||||
|
||||
Reference in New Issue
Block a user