Commit 07c810d2 authored by Peter Beverloo's avatar Peter Beverloo Committed by Commit Bot

Throw an error if SimulateWebNotificationClick argument can't be read.

Bug: 908834
Change-Id: I3b0b80f8fd31c88d29bafa5bcaff0f2f6ef104a7
Reviewed-on: https://chromium-review.googlesource.com/c/1355180Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612206}
parent 38797b5c
......@@ -1293,12 +1293,18 @@ void TestRunnerBindings::SimulateWebNotificationClick(gin::Arguments* args) {
base::Optional<int> action_index;
base::Optional<base::string16> reply;
args->GetNext(&title);
if (!args->GetNext(&title)) {
args->ThrowError();
return;
}
// Optional |action_index| argument.
if (args->Length() >= 2) {
int action_index_int;
args->GetNext(&action_index_int);
if (!args->GetNext(&action_index_int)) {
args->ThrowError();
return;
}
action_index = action_index_int;
}
......@@ -1306,7 +1312,10 @@ void TestRunnerBindings::SimulateWebNotificationClick(gin::Arguments* args) {
// Optional |reply| argument.
if (args->Length() >= 3) {
std::string reply_string;
args->GetNext(&reply_string);
if (!args->GetNext(&reply_string)) {
args->ThrowError();
return;
}
reply = base::UTF8ToUTF16(reply_string);
}
......
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