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

Convert WebTestHostMsg_InitiateCaptureDump to Mojo

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

Bug: 1039247
Change-Id: Idd38ecf67d10593f3bfc6f3c48d9832514cec595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032634
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@{#739222}
parent 2e601bd0
......@@ -101,4 +101,13 @@ void WebTestClientImpl::ResetPermissions() {
->ResetPermissions();
}
void WebTestClientImpl::InitiateCaptureDump(bool capture_navigation_history,
bool capture_pixels) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (BlinkTestController::Get()) {
BlinkTestController::Get()->OnInitiateCaptureDump(
capture_navigation_history, capture_pixels);
}
}
} // namespace content
......@@ -34,6 +34,8 @@ class WebTestClientImpl : public mojom::WebTestClient {
void SimulateWebContentIndexDelete(const std::string& id) override;
void BlockThirdPartyCookies(bool block) override;
void ResetPermissions() override;
void InitiateCaptureDump(bool capture_navigation_history,
bool capture_pixels) override;
};
} // namespace content
......
......@@ -78,7 +78,6 @@ WebTestMessageFilter::OverrideTaskRunnerForMessage(
case WebTestHostMsg_SimulateWebNotificationClick::ID:
case WebTestHostMsg_SetPermission::ID:
case WebTestHostMsg_WebTestRuntimeFlagsChanged::ID:
case WebTestHostMsg_InitiateCaptureDump::ID:
case WebTestHostMsg_DeleteAllCookies::ID:
case WebTestHostMsg_GetWritableDirectory::ID:
case WebTestHostMsg_SetFilePathForMockFileDialog::ID:
......@@ -101,8 +100,6 @@ bool WebTestMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(WebTestHostMsg_SetPermission, OnSetPermission)
IPC_MESSAGE_HANDLER(WebTestHostMsg_WebTestRuntimeFlagsChanged,
OnWebTestRuntimeFlagsChanged)
IPC_MESSAGE_HANDLER(WebTestHostMsg_InitiateCaptureDump,
OnInitiateCaptureDump)
IPC_MESSAGE_HANDLER(WebTestHostMsg_GetWritableDirectory,
OnGetWritableDirectory)
IPC_MESSAGE_HANDLER(WebTestHostMsg_SetFilePathForMockFileDialog,
......
......@@ -28,4 +28,7 @@ interface WebTestClient {
// Reset all permissions of WebTestPermissionManager.
ResetPermissions();
// Initialize to dump the main frame with a navigation history or pixels.
InitiateCaptureDump(bool capture_navigation_history, bool capture_pixels);
};
......@@ -38,9 +38,6 @@ IPC_MESSAGE_ROUTED4(WebTestHostMsg_SetPermission,
blink::mojom::PermissionStatus /* status */,
GURL /* origin */,
GURL /* embedding_origin */)
IPC_MESSAGE_ROUTED2(WebTestHostMsg_InitiateCaptureDump,
bool /* should dump navigation history */,
bool /* should dump pixels */)
IPC_SYNC_MESSAGE_ROUTED0_1(WebTestHostMsg_GetWritableDirectory,
base::FilePath /* local_path */)
......
......@@ -464,9 +464,9 @@ void BlinkTestRunner::TestFinished() {
if (interfaces->TestRunner()->ShouldDumpAsAudio()) {
CaptureLocalAudioDump();
Send(new WebTestHostMsg_InitiateCaptureDump(
routing_id(), browser_should_dump_back_forward_list,
/*browser_should_capture_pixels=*/false));
GetWebTestClientRemote().InitiateCaptureDump(
browser_should_dump_back_forward_list,
/*browser_should_capture_pixels=*/false);
return;
}
......@@ -477,9 +477,9 @@ void BlinkTestRunner::TestFinished() {
CaptureLocalLayoutDump();
if (!interfaces->TestRunner()->ShouldGeneratePixelResults()) {
Send(new WebTestHostMsg_InitiateCaptureDump(
routing_id(), browser_should_dump_back_forward_list,
/*browser_should_capture_pixels=*/false));
GetWebTestClientRemote().InitiateCaptureDump(
browser_should_dump_back_forward_list,
/*browser_should_capture_pixels=*/false);
return;
}
......@@ -497,9 +497,9 @@ void BlinkTestRunner::TestFinished() {
web_frame->GetSelectionBoundsRectForTesting();
}
}
Send(new WebTestHostMsg_InitiateCaptureDump(
routing_id(), browser_should_dump_back_forward_list,
!interfaces->TestRunner()->CanDumpPixelsFromRenderer()));
GetWebTestClientRemote().InitiateCaptureDump(
browser_should_dump_back_forward_list,
!interfaces->TestRunner()->CanDumpPixelsFromRenderer());
}
void BlinkTestRunner::CaptureLocalAudioDump() {
......
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