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() = ...@@ -3375,8 +3375,7 @@ AutotestPrivateCreateNewDeskFunction::~AutotestPrivateCreateNewDeskFunction() =
ExtensionFunction::ResponseAction AutotestPrivateCreateNewDeskFunction::Run() { ExtensionFunction::ResponseAction AutotestPrivateCreateNewDeskFunction::Run() {
const bool success = ash::AutotestDesksApi().CreateNewDesk(); const bool success = ash::AutotestDesksApi().CreateNewDesk();
return RespondNow(OneArgument( return RespondNow(OneArgument(std::make_unique<base::Value>(success)));
api::autotest_private::CreateNewDesk::Results::Create(success)));
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -3399,16 +3398,14 @@ AutotestPrivateActivateDeskAtIndexFunction::Run() { ...@@ -3399,16 +3398,14 @@ AutotestPrivateActivateDeskAtIndexFunction::Run() {
base::BindOnce( base::BindOnce(
&AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete, &AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete,
this))) { this))) {
return RespondNow(OneArgument( return RespondNow(OneArgument(std::make_unique<base::Value>(false)));
api::autotest_private::ActivateDeskAtIndex::Results::Create(false)));
} }
return RespondLater(); return RespondLater();
} }
void AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete() { void AutotestPrivateActivateDeskAtIndexFunction::OnAnimationComplete() {
Respond(OneArgument( Respond(OneArgument(std::make_unique<base::Value>(true)));
api::autotest_private::ActivateDeskAtIndex::Results::Create(true)));
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -3425,16 +3422,14 @@ AutotestPrivateRemoveActiveDeskFunction::Run() { ...@@ -3425,16 +3422,14 @@ AutotestPrivateRemoveActiveDeskFunction::Run() {
if (!ash::AutotestDesksApi().RemoveActiveDesk(base::BindOnce( if (!ash::AutotestDesksApi().RemoveActiveDesk(base::BindOnce(
&AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete, &AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete,
this))) { this))) {
return RespondNow(OneArgument( return RespondNow(OneArgument(std::make_unique<base::Value>(false)));
api::autotest_private::RemoveActiveDesk::Results::Create(false)));
} }
return RespondLater(); return RespondLater();
} }
void AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete() { void AutotestPrivateRemoveActiveDeskFunction::OnAnimationComplete() {
Respond(OneArgument( Respond(OneArgument(std::make_unique<base::Value>(true)));
api::autotest_private::RemoveActiveDesk::Results::Create(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