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

Unified Diff: content/shell/renderer/test_runner/TestRunner.cpp

Issue 183663021: Notification.permission's default value of "default" should be testable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 | content/shell/renderer/test_runner/notification_presenter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/TestRunner.cpp
diff --git a/content/shell/renderer/test_runner/TestRunner.cpp b/content/shell/renderer/test_runner/TestRunner.cpp
index 2584a3b3572ac1cfb27a78ac8add5d99403eae5a..74d35df32bb8fc2cc1d594c37a583b1a39690e8c 100644
--- a/content/shell/renderer/test_runner/TestRunner.cpp
+++ b/content/shell/renderer/test_runner/TestRunner.cpp
@@ -1821,12 +1821,15 @@ void TestRunner::setMIDISysExPermission(const CppArgumentList& arguments, CppVar
void TestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() != 1 || !arguments[0].isString()) {
- result->set(false);
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isString())
return;
- }
- notification_presenter_->GrantPermission(arguments[0].toString());
- result->set(true);
+
+ bool permissionGranted = true;
+ if (arguments.size() == 2 && arguments[1].isBool())
+ permissionGranted = arguments[1].toBoolean();
+
+ notification_presenter_->GrantPermission(arguments[0].toString(), permissionGranted);
}
void TestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/notification_presenter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698