Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: components/test_runner/test_runner.cc

Issue 1262893006: Enable testing NotificationEvent.action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@click_actions
Patch Set: TestRunnerBindings::SimulateWebNotificationClick throws for non int index Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..53db853838e1e197ba343056bc72c99b6ca54577 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,17 @@ 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;
+ int action_index = -1;
+ if (!args->GetNext(&title) ||
+ !args->PeekNext().IsEmpty() && !args->GetNext(&action_index)) {
Peter Beverloo 2015/08/07 00:11:28 nit: you could rewrite this statement to be easier
johnme 2015/08/07 07:09:54 Done.
+ args->ThrowError();
+ return;
+ }
+ runner_->SimulateWebNotificationClick(title, action_index);
}
void TestRunnerBindings::AddMockSpeechRecognitionResult(
@@ -2854,8 +2861,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,
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698