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

Unified Diff: content/shell/browser/layout_test/layout_test_message_filter.cc

Issue 659043003: Implement the ability to layout test Web Worker-based Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 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
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 d0c3b0d82d7400823c1352f65ed9a5a37e114f0b..2b80628b92721c8582885696565f073d88368d11 100644
--- a/content/shell/browser/layout_test/layout_test_message_filter.cc
+++ b/content/shell/browser/layout_test/layout_test_message_filter.cc
@@ -42,6 +42,8 @@ void LayoutTestMessageFilter::OverrideThreadForMessage(
const IPC::Message& message, BrowserThread::ID* thread) {
if (message.type() == ShellViewHostMsg_ClearAllDatabases::ID)
*thread = BrowserThread::FILE;
+ if (message.type() == ShellViewHostMsg_SimulateWebNotificationClick::ID)
+ *thread = BrowserThread::UI;
}
bool LayoutTestMessageFilter::OnMessageReceived(const IPC::Message& message) {
@@ -58,6 +60,8 @@ bool LayoutTestMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnGrantWebNotificationPermission)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearWebNotificationPermissions,
OnClearWebNotificationPermissions)
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_SimulateWebNotificationClick,
+ OnSimulateWebNotificationClick)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_AcceptAllCookies, OnAcceptAllCookies)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_DeleteAllCookies, OnDeleteAllCookies)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -128,6 +132,14 @@ void LayoutTestMessageFilter::OnClearWebNotificationPermissions() {
manager->ClearPermissions();
}
+void LayoutTestMessageFilter::OnSimulateWebNotificationClick(
+ const std::string& title) {
+ LayoutTestNotificationManager* manager =
+ LayoutTestContentBrowserClient::Get()->GetLayoutTestNotificationManager();
+ if (manager)
+ manager->SimulateClick(title);
+}
+
void LayoutTestMessageFilter::OnAcceptAllCookies(bool accept) {
ShellNetworkDelegate::SetAcceptAllCookies(accept);
}

Powered by Google App Engine
This is Rietveld 408576698