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

Unified Diff: content/shell/browser/layout_test/layout_test_content_browser_client.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_content_browser_client.cc
diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.cc b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
index 5194da29cd364dc29a82b1b2dcd9efbc1767f04d..54d42af72cf9dbc45be300c6bc95a990e5f14e80 100644
--- a/content/shell/browser/layout_test/layout_test_content_browser_client.cc
+++ b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
@@ -35,6 +35,10 @@ void RequestDesktopNotificationPermissionOnIO(
LayoutTestContentBrowserClient::LayoutTestContentBrowserClient() {
DCHECK(!g_layout_test_browser_client);
+
+ layout_test_notification_manager_.reset(
+ new LayoutTestNotificationManager());
+
g_layout_test_browser_client = this;
}
@@ -48,12 +52,6 @@ LayoutTestContentBrowserClient* LayoutTestContentBrowserClient::Get() {
LayoutTestNotificationManager*
LayoutTestContentBrowserClient::GetLayoutTestNotificationManager() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (!layout_test_notification_manager_) {
- layout_test_notification_manager_.reset(
- new LayoutTestNotificationManager());
- }
-
return layout_test_notification_manager_.get();
}
@@ -97,4 +95,13 @@ LayoutTestContentBrowserClient::CheckDesktopNotificationPermission(
return blink::WebNotificationPermissionAllowed;
}
+void LayoutTestContentBrowserClient::ShowDesktopNotification(
+ const ShowDesktopNotificationHostMsgParams& params,
+ RenderFrameHost* render_frame_host,
+ scoped_ptr<DesktopNotificationDelegate> delegate,
+ base::Closure* cancel_callback) {
+ if (auto* manager = GetLayoutTestNotificationManager())
+ manager->Show(params, delegate.Pass(), cancel_callback);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698