Commit a8f42a3e authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Convert WebTestHostMsg_ResetPermissions to Mojo

This CL migrates the legacy ResetPermissions IPC message
to the new Mojo defined in WebTestClient interface.

Bug: 1039247
Change-Id: I63e6ec066a4f4acb5e087dd3d764f56acfb45e3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032757
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738870}
parent d77e56dc
......@@ -92,4 +92,13 @@ void WebTestClientImpl::BlockThirdPartyCookies(bool block) {
BlinkTestController::Get()->OnBlockThirdPartyCookies(block);
}
void WebTestClientImpl::ResetPermissions() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
WebTestContentBrowserClient::Get()
->GetWebTestBrowserContext()
->GetWebTestPermissionManager()
->ResetPermissions();
}
} // namespace content
......@@ -33,6 +33,7 @@ class WebTestClientImpl : public mojom::WebTestClient {
bool by_user) override;
void SimulateWebContentIndexDelete(const std::string& id) override;
void BlockThirdPartyCookies(bool block) override;
void ResetPermissions() override;
};
} // namespace content
......
......@@ -77,7 +77,6 @@ WebTestMessageFilter::OverrideTaskRunnerForMessage(
return database_tracker_->task_runner();
case WebTestHostMsg_SimulateWebNotificationClick::ID:
case WebTestHostMsg_SetPermission::ID:
case WebTestHostMsg_ResetPermissions::ID:
case WebTestHostMsg_WebTestRuntimeFlagsChanged::ID:
case WebTestHostMsg_InitiateCaptureDump::ID:
case WebTestHostMsg_DeleteAllCookies::ID:
......@@ -100,7 +99,6 @@ bool WebTestMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnSimulateWebNotificationClick)
IPC_MESSAGE_HANDLER(WebTestHostMsg_DeleteAllCookies, OnDeleteAllCookies)
IPC_MESSAGE_HANDLER(WebTestHostMsg_SetPermission, OnSetPermission)
IPC_MESSAGE_HANDLER(WebTestHostMsg_ResetPermissions, OnResetPermissions)
IPC_MESSAGE_HANDLER(WebTestHostMsg_WebTestRuntimeFlagsChanged,
OnWebTestRuntimeFlagsChanged)
IPC_MESSAGE_HANDLER(WebTestHostMsg_InitiateCaptureDump,
......@@ -223,15 +221,6 @@ void WebTestMessageFilter::OnSetPermission(
->SetPermission(type, status, origin, embedding_origin);
}
void WebTestMessageFilter::OnResetPermissions() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
WebTestContentBrowserClient::Get()
->GetWebTestBrowserContext()
->GetWebTestPermissionManager()
->ResetPermissions();
}
void WebTestMessageFilter::OnWebTestRuntimeFlagsChanged(
const base::DictionaryValue& changed_web_test_runtime_flags) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......
......@@ -73,7 +73,6 @@ class WebTestMessageFilter : public BrowserMessageFilter {
blink::mojom::PermissionStatus status,
const GURL& origin,
const GURL& embedding_origin);
void OnResetPermissions();
void OnWebTestRuntimeFlagsChanged(
const base::DictionaryValue& changed_web_test_runtime_flags);
void OnInitiateCaptureDump(bool capture_navigation_history,
......
......@@ -25,4 +25,7 @@ interface WebTestClient {
// - allow all cookies when |block| is false
// - block only third-party cookies when |block| is true
BlockThirdPartyCookies(bool block);
// Reset all permissions of WebTestPermissionManager.
ResetPermissions();
};
......@@ -38,7 +38,6 @@ IPC_MESSAGE_ROUTED4(WebTestHostMsg_SetPermission,
blink::mojom::PermissionStatus /* status */,
GURL /* origin */,
GURL /* embedding_origin */)
IPC_MESSAGE_ROUTED0(WebTestHostMsg_ResetPermissions)
IPC_MESSAGE_ROUTED2(WebTestHostMsg_InitiateCaptureDump,
bool /* should dump navigation history */,
bool /* should dump pixels */)
......
......@@ -630,7 +630,7 @@ void BlinkTestRunner::SetPermission(const std::string& name,
}
void BlinkTestRunner::ResetPermissions() {
Send(new WebTestHostMsg_ResetPermissions(routing_id()));
GetWebTestClientRemote().ResetPermissions();
}
void BlinkTestRunner::DispatchBeforeInstallPromptEvent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment