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

Unified Diff: content/shell/browser/layout_test/layout_test_message_filter.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
Index: content/shell/browser/layout_test/layout_test_message_filter.cc
diff --git a/content/shell/browser/layout_test/layout_test_message_filter.cc b/content/shell/browser/layout_test/layout_test_message_filter.cc
index 567bd346cf6653f4f8cde17e0a9e893c139221be..dd9dba4d065a4d7818cce58679817b8d9b3d1d3f 100644
--- a/content/shell/browser/layout_test/layout_test_message_filter.cc
+++ b/content/shell/browser/layout_test/layout_test_message_filter.cc
@@ -50,6 +50,7 @@ void LayoutTestMessageFilter::OverrideThreadForMessage(
if (message.type() == LayoutTestHostMsg_ClearAllDatabases::ID)
*thread = BrowserThread::FILE;
if (message.type() == LayoutTestHostMsg_SimulateWebNotificationClick::ID ||
+ message.type() == LayoutTestHostMsg_SimulateWebNotificationClose::ID ||
message.type() == LayoutTestHostMsg_SetPermission::ID ||
message.type() == LayoutTestHostMsg_ResetPermissions::ID ||
message.type() == LayoutTestHostMsg_SetBluetoothAdapter::ID)
@@ -67,6 +68,8 @@ bool LayoutTestMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(LayoutTestHostMsg_SetDatabaseQuota, OnSetDatabaseQuota)
IPC_MESSAGE_HANDLER(LayoutTestHostMsg_SimulateWebNotificationClick,
OnSimulateWebNotificationClick)
+ IPC_MESSAGE_HANDLER(LayoutTestHostMsg_SimulateWebNotificationClose,
+ OnSimulateWebNotificationClose)
IPC_MESSAGE_HANDLER(LayoutTestHostMsg_AcceptAllCookies, OnAcceptAllCookies)
IPC_MESSAGE_HANDLER(LayoutTestHostMsg_DeleteAllCookies, OnDeleteAllCookies)
IPC_MESSAGE_HANDLER(LayoutTestHostMsg_SetPermission, OnSetPermission)
@@ -121,6 +124,14 @@ void LayoutTestMessageFilter::OnSimulateWebNotificationClick(
manager->SimulateClick(title, action_index);
}
+void LayoutTestMessageFilter::OnSimulateWebNotificationClose(
+ const std::string& title, bool by_user) {
+ LayoutTestNotificationManager* manager =
+ LayoutTestContentBrowserClient::Get()->GetLayoutTestNotificationManager();
+ if (manager)
+ manager->SimulateClose(title, by_user);
+}
+
void LayoutTestMessageFilter::OnAcceptAllCookies(bool accept) {
ShellNetworkDelegate::SetAcceptAllCookies(accept);
}

Powered by Google App Engine
This is Rietveld 408576698