chromium/content/browser/webui/web_ui_main_frame_observer_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/webui/web_ui_main_frame_observer.h"

#include <memory>
#include <string>

#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial_params.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "components/crash/content/browser/error_reporting/javascript_error_report.h"  // nogncheck
#include "components/crash/content/browser/error_reporting/js_error_report_processor.h"  // nogncheck
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_context.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  // namespace

class WebUIMainFrameObserverTest : public RenderViewHostTestHarness {};

constexpr char WebUIMainFrameObserverTest::kMessage8[];
constexpr char16_t WebUIMainFrameObserverTest::kMessage16[];
constexpr char WebUIMainFrameObserverTest::kSourceURL8[];
constexpr char16_t WebUIMainFrameObserverTest::kSourceURL16[];
constexpr char WebUIMainFrameObserverTest::kPageURL8[];
constexpr char WebUIMainFrameObserverTest::kStackTrace8[];
constexpr char16_t WebUIMainFrameObserverTest::kStackTrace16[];

TEST_F(WebUIMainFrameObserverTest, ErrorReported) {}

TEST_F(WebUIMainFrameObserverTest, NoStackTrace) {}

TEST_F(WebUIMainFrameObserverTest, NonErrorsIgnored) {}

TEST_F(WebUIMainFrameObserverTest, NoProcessorDoesntCrash) {}

TEST_F(WebUIMainFrameObserverTest, NotSentIfInvalidURL) {}

TEST_F(WebUIMainFrameObserverTest, NotSentIfDisabledForPage) {}

TEST_F(WebUIMainFrameObserverTest, URLPathIsPreservedOtherPartsRemoved) {}

TEST_F(WebUIMainFrameObserverTest, PageURLAlsoRedacted) {}

TEST_F(WebUIMainFrameObserverTest, ErrorsNotReportedInOtherFrames) {}

TEST_F(WebUIMainFrameObserverTest, ErrorsNotReportedForNonChromeURLs) {}

}  // namespace content

#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)