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

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

Issue 1549039: Enable support for notifications layout tests in test shell.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 8 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 | « webkit/tools/test_shell/layout_test_controller.h ('k') | webkit/tools/test_shell/notification_presenter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/layout_test_controller.cc
===================================================================
--- webkit/tools/test_shell/layout_test_controller.cc (revision 44496)
+++ webkit/tools/test_shell/layout_test_controller.cc (working copy)
@@ -25,6 +25,7 @@
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webpreferences.h"
+#include "webkit/tools/test_shell/notification_presenter.h"
#include "webkit/tools/test_shell/simple_database_system.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "webkit/tools/test_shell/test_navigation_controller.h"
@@ -135,6 +136,7 @@
BindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
BindMethod("numberOfPages", &LayoutTestController::numberOfPages);
BindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
+ BindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
// The following are stubs.
BindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
@@ -825,6 +827,17 @@
result->Set(rv);
}
+void LayoutTestController::grantDesktopNotificationPermission(
+ const CppArgumentList& args, CppVariant* result) {
+ if (args.size() != 1 || !args[0].isString()) {
+ result->Set(false);
+ return;
+ }
+ std::string origin = args[0].ToString();
+ shell_->notification_presenter()->grantPermission(origin);
+ result->Set(true);
+}
+
//
// Unimplemented stubs
//
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.h ('k') | webkit/tools/test_shell/notification_presenter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698