Commit d580be3a authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

autotestPrivate: Fix the callbacks parameter of the Desks APIs

The callbacks should be called with a single bool argument.
Using the automatically generated Create() functions made them
be called with an array of bools instead, which is not what we expect.

BUG=1016994
TEST=Run the Tast test and expect it to be able to unmarshall a bool
     from the callback.

Change-Id: I1d89de8ffcd5d78e24a9114a68f1cebb0ad6db4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900689Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713119}
parent 1edd8885
......@@ -3375,8 +3375,7 @@ AutotestPrivateCreateNewDeskFunction::~AutotestPrivateCreateNewDeskFunction() =
ExtensionFunction::ResponseAction AutotestPrivateCreateNewDeskFunction::Run() {
const bool success = ash::AutotestDesksApi().CreateNewDesk();
return RespondNow(OneArgument(
api::autotest_private::CreateNewDesk::Results::Create(success)));
return RespondNow(OneArgument(std::make_unique<base::Value>(success)));
}
///////////////////////////////////////////////////////////////////////////////
......@@ -3399,16 +3398,14 @@ AutotestPrivateActivateDeskAtIndexFunction::Run() {
base::BindOnce(
&AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete,
this))) {
return RespondNow(OneArgument(
api::autotest_private::ActivateDeskAtIndex::Results::Create(false)));
return RespondNow(OneArgument(std::make_unique<base::Value>(false)));
}
return RespondLater();
}
void AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete() {
Respond(OneArgument(
api::autotest_private::ActivateDeskAtIndex::Results::Create(true)));
Respond(OneArgument(std::make_unique<base::Value>(true)));
}
///////////////////////////////////////////////////////////////////////////////
......@@ -3425,16 +3422,14 @@ AutotestPrivateRemoveActiveDeskFunction::Run() {
if (!ash::AutotestDesksApi().RemoveActiveDesk(base::BindOnce(
&AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete,
this))) {
return RespondNow(OneArgument(
api::autotest_private::RemoveActiveDesk::Results::Create(false)));
return RespondNow(OneArgument(std::make_unique<base::Value>(false)));
}
return RespondLater();
}
void AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete() {
Respond(OneArgument(
api::autotest_private::RemoveActiveDesk::Results::Create(true)));
Respond(OneArgument(std::make_unique<base::Value>(true)));
}
///////////////////////////////////////////////////////////////////////////////
......
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