Commit 30b6ed77 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Reland "[filesapp] Add missing includes and fail if host crashed"

This reverts commit 6e991fa7

Reason for revert: MSAN error that caused the original revert was
fixed on CL:2466572.

Original change's description:
> Revert "[filesapp] Add missing includes and fail if host crashed"
>
> This reverts commit 4734ecf2.
>
> Reason for revert: https://crrev.com/c/2461602 breaks build Linux ChromiumOS MSan Tests in https://ci.chromium.org/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/20900
> Failed test is DevToolsListenerBrowserTest.CanCollectCodeCoverage
>
> Original change's description:
> > [filesapp] Add missing includes and fail if host crashed
> >
> > Adds #include's that were missing from the initial patch, and FAIL the
> > test if the DevToolsAgentHost attached to crashes during the test.
> >
> > Fix HostString() helper to *actually* take an optional prefix: use C++
> > c++17 {} style initializer.
> >
> > Test: browser_test --gtest_filter="*DevToolsListener*"
> > Bug: 1113941
> > Change-Id: I5901019add9fea92b6e3a8b5b881b8d3d197b6c0
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465456
> > Commit-Queue: Ben Reich <benreich@chromium.org>
> > Reviewed-by: Noel Gordon <noel@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#816070}
>
> TBR=noel@chromium.org,benreich@chromium.org
>
> Change-Id: I87ec9b3db970807af8fc75ca137fc83397f775bf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1113941
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466016
> Reviewed-by: Maggie Cai <mxcai@chromium.org>
> Commit-Queue: Maggie Cai <mxcai@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#816400}

TBR=noel@chromium.org,mxcai@chromium.org,benreich@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: 1113941
Change-Id: I10432537826bc0ecd3938230b8454a9f1dbd8cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465900
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816490}
parent 9f3eb15c
......@@ -72,7 +72,7 @@ void DevToolsListener::Detach(content::DevToolsAgentHost* host) {
}
std::string DevToolsListener::HostString(content::DevToolsAgentHost* host,
const std::string& prefix = "") {
const std::string& prefix) {
std::string result = base::StrCat(
{prefix, " ", host->GetType(), " title: ", host->GetTitle()});
std::string description = host->GetDescription();
......
......@@ -42,7 +42,7 @@ class DevToolsListener : public content::DevToolsAgentHostClient {
// Returns a string that uniquely identifies a host
// with an optional prefix.
static std::string HostString(content::DevToolsAgentHost* host,
const std::string& prefix);
const std::string& prefix = {});
private:
// Enable CDP on host.
......
......@@ -3,16 +3,20 @@
// found in the LICENSE file.
#include <map>
#include <memory>
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/process/process_handle.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/chromeos/file_manager/devtools_listener.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_agent_host_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
......@@ -55,7 +59,7 @@ class DevToolsListenerBrowserTest : public content::DevToolsAgentHostObserver,
base::TerminationStatus status) override {
if (devtools_agent_.find(host) == devtools_agent_.end())
return;
NOTREACHED();
LOG(FATAL) << "Host crashed: " << DevToolsListener::HostString(host);
}
void CollectCodeCoverage() {
......
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