#include "headless/public/headless_web_contents.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/base64.h"
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
#include "cc/test/pixel_test_utils.h"
#include "components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.h"
#include "components/viz/common/switches.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "headless/lib/browser/headless_web_contents_impl.h"
#include "headless/public/headless_browser.h"
#include "headless/test/headless_browser_test.h"
#include "headless/test/headless_browser_test_utils.h"
#include "headless/test/headless_devtooled_browsertest.h"
#include "headless/test/test_network_interceptor.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_f.h"
#include "url/gurl.h"
ElementsAre;
ElementsAreArray;
Not;
UnorderedElementsAre;
UnorderedElementsAreArray;
SimpleDevToolsProtocolClient;
namespace headless {
class HeadlessWebContentsTest : public HeadlessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, Navigation) { … }
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, WindowOpen) { … }
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest,
FocusOfHeadlessWebContents_IsIndependent) { … }
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, HandleSSLError) { … }
namespace {
bool DecodePNG(const std::string& png_data, SkBitmap* bitmap) { … }
}
class HeadlessWebContentsScreenshotTest
: public HeadlessDevTooledBrowserTest,
public ::testing::WithParamInterface<bool> { … };
HEADLESS_DEVTOOLED_TEST_P(HeadlessWebContentsScreenshotTest);
INSTANTIATE_TEST_SUITE_P(…);
class HeadlessWebContentsScreenshotWindowPositionTest
: public HeadlessWebContentsScreenshotTest { … };
HEADLESS_DEVTOOLED_TEST_P(HeadlessWebContentsScreenshotWindowPositionTest);
INSTANTIATE_TEST_SUITE_P(…);
class HeadlessWebContentsRequestStorageQuotaTest
: public HeadlessDevTooledBrowserTest { … };
HEADLESS_DEVTOOLED_TEST_F(HeadlessWebContentsRequestStorageQuotaTest);
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, BrowserTabChangeContent) { … }
IN_PROC_BROWSER_TEST_F(HeadlessWebContentsTest, BrowserOpenInTab) { … }
#if !BUILDFLAG(IS_MAC)
class HeadlessWebContentsBeginFrameControlTest : public HeadlessBrowserTest { … };
class HeadlessWebContentsBeginFrameControlBasicTest
: public HeadlessWebContentsBeginFrameControlTest { … };
HEADLESS_DEVTOOLED_TEST_F(HeadlessWebContentsBeginFrameControlBasicTest);
class HeadlessWebContentsBeginFrameControlViewportTest
: public HeadlessWebContentsBeginFrameControlTest { … };
DISABLED_HEADLESS_DEVTOOLED_TEST_F(
HeadlessWebContentsBeginFrameControlViewportTest);
#endif
class CookiesEnabled : public HeadlessDevTooledBrowserTest { … };
HEADLESS_DEVTOOLED_TEST_F(CookiesEnabled);
namespace {
const char* kPageWhichOpensAWindow = …;
const char* kPage2 = …;
}
class WebContentsOpenTest : public HeadlessDevTooledBrowserTest { … };
class DontBlockWebContentsOpenTest : public WebContentsOpenTest { … };
HEADLESS_DEVTOOLED_TEST_F(DontBlockWebContentsOpenTest);
class BlockWebContentsOpenTest : public WebContentsOpenTest { … };
HEADLESS_DEVTOOLED_TEST_F(BlockWebContentsOpenTest);
class BlockDevToolsEmbedding : public HeadlessDevTooledBrowserTest { … };
HEADLESS_DEVTOOLED_TEST_F(BlockDevToolsEmbedding);
}