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

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: 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
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..4826862c15c2bdf1cc84989398044020e4c70352 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -274,6 +274,8 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetPOSIXLocale(const std::string& locale);
void SetMIDIAccessorResult(bool result);
void SimulateWebNotificationClick(const std::string& title);
+ void SimulateWebNotificationActionClick(const std::string& title,
Peter Beverloo 2015/08/04 21:08:33 Can we overload methods here? We shouldn't have tw
johnme 2015/08/05 13:51:27 Done, using gin::Arguments*.
+ int action_index);
void AddMockSpeechRecognitionResult(const std::string& transcript,
double confidence);
void SetMockSpeechRecognitionError(const std::string& error,
@@ -542,6 +544,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::SetMIDIAccessorResult)
.SetMethod("simulateWebNotificationClick",
&TestRunnerBindings::SimulateWebNotificationClick)
+ .SetMethod("simulateWebNotificationActionClick",
+ &TestRunnerBindings::SimulateWebNotificationActionClick)
.SetMethod("addMockSpeechRecognitionResult",
&TestRunnerBindings::AddMockSpeechRecognitionResult)
.SetMethod("setMockSpeechRecognitionError",
@@ -1346,7 +1350,13 @@ void TestRunnerBindings::SetMIDIAccessorResult(bool result) {
void TestRunnerBindings::SimulateWebNotificationClick(
const std::string& title) {
if (runner_)
- runner_->SimulateWebNotificationClick(title);
+ runner_->SimulateWebNotificationClick(title, -1 /* action_index */);
+}
+
+void TestRunnerBindings::SimulateWebNotificationActionClick(
+ const std::string& title, int action_index) {
+ if (runner_)
+ runner_->SimulateWebNotificationClick(title, action_index);
}
void TestRunnerBindings::AddMockSpeechRecognitionResult(
@@ -2854,8 +2864,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,

Powered by Google App Engine
This is Rietveld 408576698