Commit 479d9467 authored by danakj's avatar danakj Committed by Commit Bot

Allow fuzzers to close the main window while capturing test results

In that case we can't wait for results, and we just end the test instead
of crashing.

R=avi@chromium.org

Bug: 866140, 1098835
Change-Id: I954be9e0ec795d5e17dbfb054b2c4479e3d772ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264938Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782026}
parent 23998bf2
......@@ -794,6 +794,15 @@ void WebTestControlHost::TestFinishedInSecondaryRenderer() {
// Enqueue an image copy output request.
void WebTestControlHost::EnqueueSurfaceCopyRequest() {
// Under fuzzing, the renderer may close the |main_window_| while we're
// capturing test results, as demonstrated by https://crbug.com/1098835.
// We must handle this bad behaviour, and we just end the test without
// recording any results.
if (!main_window_) {
OnTestFinished();
return;
}
auto* rwhv = main_window_->web_contents()->GetRenderWidgetHostView();
rwhv->CopyFromSurface(gfx::Rect(), gfx::Size(),
base::BindOnce(&WebTestControlHost::OnPixelDumpCaptured,
......
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