Commit 6fca28e6 authored by Rahul Goyal's avatar Rahul Goyal Committed by Chromium LUCI CQ

[Autofill Assistant] Feature to disable onboarding flow.

Before this patch, it was not possible to disable Autofill Assistant
onboarding flow via feature.

This patch, includes the changes to disable onboarding
flow via feature.

After this patch, it would be possible to disable
onboarding flow via feature.

Bug: b/174122295
Change-Id: Ieee6022f42cbe82bbcd908a7923a1c47716c6569
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560748Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Reviewed-by: default avatarClemens Arbesser <arbesser@google.com>
Commit-Queue: Rahul Goyal <goyalrahul@google.com>
Cr-Commit-Position: refs/heads/master@{#832408}
parent 29fce993
......@@ -358,6 +358,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
@Test
@MediumTest
@Features.EnableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP)
@Features.DisableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_DISABLE_ONBOARDING_FLOW)
public void transitionToRegularScriptWithoutOnboarding() throws Exception {
TriggerScriptProto.Builder triggerScript =
TriggerScriptProto
......@@ -481,4 +482,51 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
waitUntilViewMatchesCondition(withText("Done"), isCompletelyDisplayed());
onView(withText("Loading regular script")).check(matches(isDisplayed()));
}
@Test
@MediumTest
@Features.EnableFeatures({ChromeFeatureList.AUTOFILL_ASSISTANT_DISABLE_ONBOARDING_FLOW,
ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP})
public void
transitionToRegularScriptWithoutOnboardingWithDisableOnboardingFlowFeatureOn()
throws Exception {
TriggerScriptProto.Builder triggerScript =
TriggerScriptProto
.newBuilder()
/* no trigger condition */
.setUserInterface(createDefaultUI("Trigger script",
/* bubbleMessage = */ "",
/* withProgressBar = */ false)
.setRegularScriptLoadingStatusMessage(
"Loading regular script"));
GetTriggerScriptsResponseProto triggerScripts =
(GetTriggerScriptsResponseProto) GetTriggerScriptsResponseProto.newBuilder()
.addTriggerScripts(triggerScript)
.build();
setupTriggerScripts(triggerScripts);
AutofillAssistantPreferencesUtil.setInitialPreferences(false);
startAutofillAssistantOnTab(TEST_PAGE);
waitUntilViewMatchesCondition(withText("Trigger script"), isCompletelyDisplayed());
ArrayList<ActionProto> list = new ArrayList<>();
list.add((ActionProto) ActionProto.newBuilder()
.setPrompt(PromptProto.newBuilder().addChoices(
PromptProto.Choice.newBuilder().setChip(
ChipProto.newBuilder().setText("Done"))))
.build());
AutofillAssistantTestScript script = new AutofillAssistantTestScript(
(SupportedScriptProto) SupportedScriptProto.newBuilder()
.setPath(TEST_PAGE)
.setPresentation(PresentationProto.newBuilder().setAutostart(true).setChip(
ChipProto.newBuilder().setText("Done")))
.build(),
list);
setupRegularScripts(script);
onView(withText("Continue")).perform(click());
waitUntilViewMatchesCondition(withText("Done"), isCompletelyDisplayed());
onView(withText("Loading regular script")).check(matches(isDisplayed()));
}
}
......@@ -100,6 +100,10 @@ public class AutofillAssistantPreferencesUtil {
/** Checks whether the Autofill Assistant onboarding screen should be shown. */
static boolean getShowOnboarding() {
if (ChromeFeatureList.isEnabled(
ChromeFeatureList.AUTOFILL_ASSISTANT_DISABLE_ONBOARDING_FLOW)) {
return false;
}
return !isAutofillAssistantSwitchOn() || !isAutofillOnboardingAccepted();
}
......
......@@ -79,6 +79,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&autofill_assistant::features::kAutofillAssistant,
&autofill_assistant::features::kAutofillAssistantChromeEntry,
&autofill_assistant::features::kAutofillAssistantDirectActions,
&autofill_assistant::features::kAutofillAssistantDisableOnboardingFlow,
&autofill_assistant::features::kAutofillAssistantProactiveHelp,
&autofill_assistant::features::
kAutofillAssistantDisableProactiveHelpTiedToMSBB,
......
......@@ -219,6 +219,8 @@ public abstract class ChromeFeatureList {
public static final String AUTOFILL_ASSISTANT = "AutofillAssistant";
public static final String AUTOFILL_ASSISTANT_CHROME_ENTRY = "AutofillAssistantChromeEntry";
public static final String AUTOFILL_ASSISTANT_DIRECT_ACTIONS = "AutofillAssistantDirectActions";
public static final String AUTOFILL_ASSISTANT_DISABLE_ONBOARDING_FLOW =
"AutofillAssistantDisableOnboardingFlow";
public static final String AUTOFILL_ASSISTANT_PROACTIVE_HELP = "AutofillAssistantProactiveHelp";
public static final String AUTOFILL_ASSISTANT_DISABLE_PROACTIVE_HELP_TIED_TO_MSBB =
"AutofillAssistantDisableProactiveHelpTiedToMSBB";
......
......@@ -19,6 +19,11 @@ const base::Feature kAutofillAssistantChromeEntry{
const base::Feature kAutofillAssistantDirectActions{
"AutofillAssistantDirectActions", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether to disable onboarding flow for Autofill Assistant
const base::Feature kAutofillAssistantDisableOnboardingFlow{
"AutofillAssistantDisableOnboardingFlow",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillAssistantProactiveHelp{
"AutofillAssistantProactiveHelp", base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -16,6 +16,7 @@ namespace features {
extern const base::Feature kAutofillAssistant;
extern const base::Feature kAutofillAssistantChromeEntry;
extern const base::Feature kAutofillAssistantDirectActions;
extern const base::Feature kAutofillAssistantDisableOnboardingFlow;
extern const base::Feature kAutofillAssistantProactiveHelp;
extern const base::Feature kAutofillAssistantWithTabHelper;
extern const base::Feature kAutofillAssistantDisableProactiveHelpTiedToMSBB;
......
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