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

Unified Diff: components/test_runner/test_runner.cc

Issue 2403893002: Add layout test for reply property of notificationclick event (Closed)
Patch Set: Make reply field nullable in .idl files; add test cases for empty and null Created 4 years, 2 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 86185b48a8917e53e83714249e615ee18fc4d34a..e3097f3025031ddfc75505d3c4014b75add1415e 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -11,8 +11,10 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/strings/nullable_string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/test_runner/app_banner_client.h"
#include "components/test_runner/layout_and_paint_async_then.h"
@@ -252,6 +254,9 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetXSSAuditorEnabled(bool enabled);
void ShowWebInspector(gin::Arguments* args);
void SimulateWebNotificationClick(const std::string& title, int action_index);
+ void SimulateWebNotificationClickWithReply(const std::string& title,
+ int action_index,
+ const std::string& reply);
void SimulateWebNotificationClose(const std::string& title, bool by_user);
void UseUnfortunateSynchronousResizeMode();
void WaitForPolicyDelegate();
@@ -576,6 +581,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector)
.SetMethod("simulateWebNotificationClick",
&TestRunnerBindings::SimulateWebNotificationClick)
+ .SetMethod("simulateWebNotificationClickWithReply",
+ &TestRunnerBindings::SimulateWebNotificationClickWithReply)
.SetMethod("simulateWebNotificationClose",
&TestRunnerBindings::SimulateWebNotificationClose)
.SetProperty("tooltipText", &TestRunnerBindings::TooltipText)
@@ -1357,7 +1364,19 @@ void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title,
int action_index) {
if (!runner_)
return;
- runner_->SimulateWebNotificationClick(title, action_index);
+ runner_->SimulateWebNotificationClick(title, action_index,
+ base::NullableString16());
+}
+
+void TestRunnerBindings::SimulateWebNotificationClickWithReply(
+ const std::string& title,
+ int action_index,
+ const std::string& reply) {
+ if (!runner_)
+ return;
+ runner_->SimulateWebNotificationClick(
+ title, action_index,
+ base::NullableString16(base::UTF8ToUTF16(reply), false /* is_null */));
}
void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title,
@@ -2685,9 +2704,11 @@ void TestRunner::SetMIDIAccessorResult(bool result) {
midi_accessor_result_ = result;
}
-void TestRunner::SimulateWebNotificationClick(const std::string& title,
- int action_index) {
- delegate_->SimulateWebNotificationClick(title, action_index);
+void TestRunner::SimulateWebNotificationClick(
+ const std::string& title,
+ int action_index,
+ const base::NullableString16& reply) {
+ delegate_->SimulateWebNotificationClick(title, action_index, reply);
}
void TestRunner::SimulateWebNotificationClose(const std::string& title,
« 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