Chromium Code Reviews| Index: components/test_runner/test_runner.cc |
| diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc |
| index 1f156c68436a6441793b7a91523f0b2dc1b5de53..4b9ae484faace3a2cadd31e3220e8b51ee514e2c 100644 |
| --- a/components/test_runner/test_runner.cc |
| +++ b/components/test_runner/test_runner.cc |
| @@ -273,7 +273,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
| v8::Local<v8::Function> callback); |
| void SetPOSIXLocale(const std::string& locale); |
| void SetMIDIAccessorResult(bool result); |
| - void SimulateWebNotificationClick(const std::string& title); |
| + void SimulateWebNotificationClick(gin::Arguments* args); |
| void AddMockSpeechRecognitionResult(const std::string& transcript, |
| double confidence); |
| void SetMockSpeechRecognitionError(const std::string& error, |
| @@ -1343,10 +1343,18 @@ void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
| runner_->SetMIDIAccessorResult(result); |
| } |
| -void TestRunnerBindings::SimulateWebNotificationClick( |
| - const std::string& title) { |
| - if (runner_) |
| - runner_->SimulateWebNotificationClick(title); |
| +void TestRunnerBindings::SimulateWebNotificationClick(gin::Arguments* args) { |
| + if (!runner_) |
| + return; |
| + std::string title; |
| + if (!args->GetNext(&title)) { |
| + args->ThrowError(); |
| + return; |
| + } |
| + int action_index = -1; |
| + if (!args->PeekNext().IsEmpty()) |
| + args->GetNext(&action_index); |
|
jochen (gone - plz use gerrit)
2015/08/05 15:09:16
what if the 2nd parameter isn't an integer? should
johnme
2015/08/06 18:25:47
Done (oddly, none of the other methods taking gin:
|
| + runner_->SimulateWebNotificationClick(title, action_index); |
| } |
| void TestRunnerBindings::AddMockSpeechRecognitionResult( |
| @@ -2854,8 +2862,9 @@ void TestRunner::SetMIDIAccessorResult(bool result) { |
| midi_accessor_result_ = result; |
| } |
| -void TestRunner::SimulateWebNotificationClick(const std::string& title) { |
| - delegate_->SimulateWebNotificationClick(title); |
| +void TestRunner::SimulateWebNotificationClick(const std::string& title, |
| + int action_index) { |
| + delegate_->SimulateWebNotificationClick(title, action_index); |
| } |
| void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript, |