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

Unified Diff: components/test_runner/test_runner.cc

Issue 1656823002: Add layout tests for ServiceWorker's notificationclose event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored data reflection tests + nits Created 4 years, 11 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 16799fcefa6c56e49128d7043d0e2db551b498d8..7dc3e932fe7f3fe752ce9af8ed1270ab3c8495ce 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -296,6 +296,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetPOSIXLocale(const std::string& locale);
void SetMIDIAccessorResult(bool result);
void SimulateWebNotificationClick(const std::string& title, int action_index);
+ void SimulateWebNotificationClose(const std::string& title, bool by_user);
void AddMockSpeechRecognitionResult(const std::string& transcript,
double confidence);
void SetMockSpeechRecognitionError(const std::string& error,
@@ -572,6 +573,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::SetMIDIAccessorResult)
.SetMethod("simulateWebNotificationClick",
&TestRunnerBindings::SimulateWebNotificationClick)
+ .SetMethod("simulateWebNotificationClose",
+ &TestRunnerBindings::SimulateWebNotificationClose)
.SetMethod("addMockSpeechRecognitionResult",
&TestRunnerBindings::AddMockSpeechRecognitionResult)
.SetMethod("setMockSpeechRecognitionError",
@@ -1420,6 +1423,13 @@ void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title,
runner_->SimulateWebNotificationClick(title, action_index);
}
+void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title,
+ bool by_user) {
+ if (!runner_)
+ return;
+ runner_->SimulateWebNotificationClose(title, by_user);
+}
+
void TestRunnerBindings::AddMockSpeechRecognitionResult(
const std::string& transcript, double confidence) {
if (runner_)
@@ -2988,6 +2998,11 @@ void TestRunner::SimulateWebNotificationClick(const std::string& title,
delegate_->SimulateWebNotificationClick(title, action_index);
}
+void TestRunner::SimulateWebNotificationClose(const std::string& title,
+ bool by_user) {
+ delegate_->SimulateWebNotificationClose(title, by_user);
+}
+
void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript,
double confidence) {
proxy_->GetSpeechRecognizerMock()->AddMockResult(
« 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