Index: content/shell/renderer/test_runner/test_runner.cc |
diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc |
index 9e280747656eb04f990c2c9b398bfd5b428c44f0..44a5bc8932c5005e3fc696fcbbe73bf5ae1903f4 100644 |
--- a/content/shell/renderer/test_runner/test_runner.cc |
+++ b/content/shell/renderer/test_runner/test_runner.cc |
@@ -270,6 +270,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
void SetMIDIAccessorResult(bool result); |
void SetMIDISysexPermission(bool value); |
void GrantWebNotificationPermission(gin::Arguments* args); |
+ void ClearWebNotificationPermissions(); |
bool SimulateWebNotificationClick(const std::string& value); |
void AddMockSpeechRecognitionResult(const std::string& transcript, |
double confidence); |
@@ -513,6 +514,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
&TestRunnerBindings::SetMIDISysexPermission) |
.SetMethod("grantWebNotificationPermission", |
&TestRunnerBindings::GrantWebNotificationPermission) |
+ .SetMethod("clearWebNotificationPermissions", |
+ &TestRunnerBindings::ClearWebNotificationPermissions) |
.SetMethod("simulateWebNotificationClick", |
&TestRunnerBindings::SimulateWebNotificationClick) |
.SetMethod("addMockSpeechRecognitionResult", |
@@ -1295,10 +1298,16 @@ void TestRunnerBindings::GrantWebNotificationPermission(gin::Arguments* args) { |
bool permission_granted = true; |
args->GetNext(&origin); |
args->GetNext(&permission_granted); |
- return runner_->GrantWebNotificationPermission(origin, permission_granted); |
+ return runner_->GrantWebNotificationPermission(GURL(origin), |
+ permission_granted); |
} |
} |
+void TestRunnerBindings::ClearWebNotificationPermissions() { |
+ if (runner_) |
+ runner_->ClearWebNotificationPermissions(); |
+} |
+ |
bool TestRunnerBindings::SimulateWebNotificationClick( |
const std::string& value) { |
if (runner_) |
@@ -2729,9 +2738,13 @@ void TestRunner::SetMIDISysexPermission(bool value) { |
windowList.at(i)->GetMIDIClientMock()->setSysexPermission(value); |
} |
-void TestRunner::GrantWebNotificationPermission(const std::string& origin, |
+void TestRunner::GrantWebNotificationPermission(const GURL& origin, |
bool permission_granted) { |
- notification_presenter_->GrantPermission(origin, permission_granted); |
+ delegate_->grantWebNotificationPermission(origin, permission_granted); |
+} |
+ |
+void TestRunner::ClearWebNotificationPermissions() { |
+ delegate_->clearWebNotificationPermissions(); |
} |
bool TestRunner::SimulateWebNotificationClick(const std::string& value) { |