Commit ba1715e2 authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

[Autofill Assistant] Fix delayed prompt state issue.

Before this patch, the controller would stay in the running state
between the end of a script and the time runnable scripts were found.

In practice, for users, this meant that the website could be available,
but keyboard could be unavailable until a runnable script is found.
During that time the progress bar should have been pulsing but wasn't.

After this patch, the controller enters the prompt state immediately
after running a script, starting the pulsing and making the keyboard
available right away.

The cost of this is that in some corner case, the state can switch to
the prompt state then quickly enter an error case.

Bug: 122825639
Change-Id: Id4927a750370ec59e5c1216ebac01d54e377b2f3
Reviewed-on: https://chromium-review.googlesource.com/c/1442711
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626996}
parent 447ae27d
......@@ -319,6 +319,7 @@ void Controller::OnScriptExecuted(const std::string& script_path,
DLOG(ERROR) << "Unexpected value for at_end: " << result.at_end;
break;
}
EnterState(AutofillAssistantState::PROMPT);
GetOrCheckScripts(web_contents()->GetLastCommittedURL());
}
......
......@@ -513,6 +513,7 @@ TEST_F(ControllerTest, StateChanges) {
EXPECT_EQ(AutofillAssistantState::STOPPED, GetUiDelegate()->GetState());
EXPECT_THAT(states_, ElementsAre(AutofillAssistantState::RUNNING,
AutofillAssistantState::PROMPT,
AutofillAssistantState::STOPPED));
}
} // namespace autofill_assistant
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