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

Unified Diff: webkit/tools/test_shell/notification_presenter.cc

Issue 2608001: Change the test notification presenter to fire the display event asynchronous... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/notification_presenter.cc
===================================================================
--- webkit/tools/test_shell/notification_presenter.cc (revision 48839)
+++ webkit/tools/test_shell/notification_presenter.cc (working copy)
@@ -4,6 +4,8 @@
#include "webkit/tools/test_shell/notification_presenter.h"
+#include "base/message_loop.h"
+#include "base/task.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotification.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotificationPermissionCallback.h"
@@ -18,6 +20,12 @@
using WebKit::WebString;
using WebKit::WebURL;
+namespace {
+void DeferredDisplayDispatch(WebNotification notification) {
+ notification.dispatchDisplayEvent();
+}
+}
+
void TestNotificationPresenter::grantPermission(const std::string& origin) {
// Make sure it's in the form of an origin.
GURL url(origin);
@@ -51,8 +59,10 @@
notification.body().utf8().data());
}
+
WebNotification event_target(notification);
- event_target.dispatchDisplayEvent();
+ MessageLoop::current()->PostTask(FROM_HERE,
+ NewRunnableFunction(&DeferredDisplayDispatch, event_target));
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698