#include "content/browser/devtools/devtools_frontend_host_impl.h"
#include <memory>
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "components/crash/content/browser/error_reporting/javascript_error_report.h"
#include "components/crash/content/browser/error_reporting/js_error_report_processor.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/test/test_web_contents.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
namespace content {
namespace {
Eq;
Optional;
class FakeJsErrorReportProcessor : public JsErrorReportProcessor { … };
}
class DevToolsFrontendHostImplTest : public RenderViewHostTestHarness { … };
class DevToolsFrontendHostImplJsErrorReportingEnabledTest
: public DevToolsFrontendHostImplTest { … };
constexpr char DevToolsFrontendHostImplTest::kMessage8[];
constexpr char16_t DevToolsFrontendHostImplTest::kMessage16[];
constexpr char DevToolsFrontendHostImplTest::kSourceURL8[];
constexpr char16_t DevToolsFrontendHostImplTest::kSourceURL16[];
constexpr char DevToolsFrontendHostImplTest::kStackTrace8[];
constexpr char16_t DevToolsFrontendHostImplTest::kStackTrace16[];
TEST_F(DevToolsFrontendHostImplTest, ErrorNotReportedWhenFeatureIsNotEnabled) { … }
TEST_F(DevToolsFrontendHostImplJsErrorReportingEnabledTest, Sent) { … }
TEST_F(DevToolsFrontendHostImplJsErrorReportingEnabledTest,
NotSentForNonErrors) { … }
TEST_F(DevToolsFrontendHostImplJsErrorReportingEnabledTest,
NotSentIfInvalidURL) { … }
TEST_F(DevToolsFrontendHostImplJsErrorReportingEnabledTest,
NotSentIfNonDevToolsURL) { … }
}
#endif