#include "headless/test/headless_browser_test.h"
#include <memory>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/task/current_thread.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/url_constants.h"
#include "gin/v8_initializer.h"
#include "headless/lib/browser/headless_browser_impl.h"
#include "headless/lib/browser/headless_browser_main_parts.h"
#include "headless/lib/browser/headless_web_contents_impl.h"
#include "headless/lib/headless_content_main_delegate.h"
#include "headless/public/headless_web_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "tools/v8_context_snapshot/buildflags.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_switches.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_MAC)
#include "services/device/public/cpp/test/fake_geolocation_system_permission_manager.h"
#endif
namespace headless {
HeadlessBrowserTest::HeadlessBrowserTest() { … }
void HeadlessBrowserTest::SetUp() { … }
void HeadlessBrowserTest::SetUpWithoutGPU() { … }
HeadlessBrowserTest::~HeadlessBrowserTest() = default;
void HeadlessBrowserTest::PreRunTestOnMainThread() { … }
void HeadlessBrowserTest::PostRunTestOnMainThread() { … }
#if BUILDFLAG(IS_MAC)
void HeadlessBrowserTest::CreatedBrowserMainParts(
content::BrowserMainParts* parts) {
auto fake_geolocation_system_permission_manager =
std::make_unique<device::FakeGeolocationSystemPermissionManager>();
fake_geolocation_system_permission_manager->SetSystemPermission(
device::LocationSystemPermissionStatus::kAllowed);
static_cast<HeadlessBrowserImpl*>(browser())
->SetGeolocationSystemPermissionManagerForTesting(
std::move(fake_geolocation_system_permission_manager));
}
#endif
HeadlessBrowser* HeadlessBrowserTest::browser() const { … }
HeadlessBrowser::Options* HeadlessBrowserTest::options() const { … }
void HeadlessBrowserTest::RunAsynchronousTest() { … }
void HeadlessBrowserTest::FinishAsynchronousTest() { … }
}