Commit 6e991fa7 authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

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