Skip to content

Commit

Permalink
fix a layout test crash due to no browser window
Browse files Browse the repository at this point in the history
The test opens a link to a pdf, which results in a download and closing the
tab immediately.
As a result, the crash could triggered by potential race between shut down the
content shell and opening the download.

BUG=707599

Review-Url: https://codereview.chromium.org/2842023003
Cr-Commit-Position: refs/heads/master@{#467392}
  • Loading branch information
qinmin authored and Commit bot committed Apr 26, 2017
1 parent 5ea7862 commit 58a9ac7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ LayoutTestDownloadManagerDelegate::~LayoutTestDownloadManagerDelegate(){
bool LayoutTestDownloadManagerDelegate::ShouldOpenDownload(
DownloadItem* item,
const DownloadOpenDelayedCallback& callback) {
if (BlinkTestController::Get()->IsMainWindow(item->GetWebContents()) &&
if (BlinkTestController::Get() &&
BlinkTestController::Get()->IsMainWindow(item->GetWebContents()) &&
item->GetMimeType() == "text/html") {
BlinkTestController::Get()->OpenURL(
net::FilePathToFileURL(item->GetFullPath()));
Expand Down

0 comments on commit 58a9ac7

Please sign in to comment.