Commit bc1da3d9 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Tast: Fix Assistant open Android app test

Bug: b/150238588
Test: Running the test locally for 20+ times
Change-Id: I320c8a3c0d1f2e2cfc0155de950632649025c633
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076795
Commit-Queue: Yue Li <updowndota@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745228}
parent 12089303
......@@ -2389,6 +2389,7 @@ class AssistantInteractionHelper
void OnOpenAppResponse(chromeos::assistant::mojom::AndroidAppInfoPtr app_info,
OnOpenAppResponseCallback callback) override {
result_.SetKey("openAppResponse", base::Value(app_info->package_name));
std::move(callback).Run(true);
}
void OnSuggestionsResponse(
......@@ -2463,6 +2464,8 @@ AutotestPrivateSendAssistantTextQueryFunction::Run() {
void AutotestPrivateSendAssistantTextQueryFunction::
OnInteractionFinishedCallback(bool success) {
// |timeout_timer_| need to be hold until |Respond(.)| is called to avoid
// |this| being destructed.
if (!success) {
Respond(Error("Interaction ends abnormally."));
timeout_timer_.AbandonAndStop();
......@@ -2519,6 +2522,8 @@ AutotestPrivateWaitForAssistantQueryStatusFunction::Run() {
void AutotestPrivateWaitForAssistantQueryStatusFunction::
OnInteractionFinishedCallback(bool success) {
// |timeout_timer_| need to be hold until |Respond(.)| is called to avoid
// |this| being destructed.
if (!success) {
Respond(Error("Interaction ends abnormally."));
timeout_timer_.AbandonAndStop();
......
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