#include "chrome/browser/vr/test/xr_browser_test.h"
#include <cstring>
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/path_service.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_ANDROID)
#else
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#endif
namespace vr {
constexpr base::TimeDelta XrBrowserTestBase::kPollCheckIntervalShort;
constexpr base::TimeDelta XrBrowserTestBase::kPollCheckIntervalLong;
constexpr base::TimeDelta XrBrowserTestBase::kPollTimeoutShort;
constexpr base::TimeDelta XrBrowserTestBase::kPollTimeoutMedium;
constexpr base::TimeDelta XrBrowserTestBase::kPollTimeoutLong;
constexpr char XrBrowserTestBase::kOpenXrConfigPathEnvVar[];
constexpr char XrBrowserTestBase::kOpenXrConfigPathVal[];
constexpr char XrBrowserTestBase::kTestFileDir[];
constexpr char XrBrowserTestBase::kSwitchIgnoreRuntimeRequirements[];
const std::vector<std::string> XrBrowserTestBase::kRequiredTestSwitches{ … };
const std::vector<std::pair<std::string, std::string>>
XrBrowserTestBase::kRequiredTestSwitchesWithValues{ … };
XrBrowserTestBase::XrBrowserTestBase() : … { … }
XrBrowserTestBase::~XrBrowserTestBase() = default;
base::FilePath::StringType UTF8ToWideIfNecessary(std::string input) { … }
std::string WideToUTF8IfNecessary(base::FilePath::StringType input) { … }
std::string MakeExecutableRelative(const char* path) { … }
void XrBrowserTestBase::SetUp() { … }
void XrBrowserTestBase::TearDown() { … }
XrBrowserTestBase::RuntimeType XrBrowserTestBase::GetRuntimeType() const { … }
GURL XrBrowserTestBase::GetUrlForFile(const std::string& test_name) { … }
net::EmbeddedTestServer* XrBrowserTestBase::GetEmbeddedServer() { … }
content::WebContents* XrBrowserTestBase::GetCurrentWebContents() { … }
void XrBrowserTestBase::SetIncognito() { … }
void XrBrowserTestBase::OpenNewTab(const std::string& url) { … }
void XrBrowserTestBase::OpenNewTab(const std::string& url, bool incognito) { … }
void XrBrowserTestBase::LoadFileAndAwaitInitialization(
const std::string& test_name) { … }
void XrBrowserTestBase::RunJavaScriptOrFail(
const std::string& js_expression,
content::WebContents* web_contents) { … }
bool XrBrowserTestBase::RunJavaScriptAndExtractBoolOrFail(
const std::string& js_expression,
content::WebContents* web_contents) { … }
std::string XrBrowserTestBase::RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression,
content::WebContents* web_contents) { … }
bool XrBrowserTestBase::PollJavaScriptBoolean(
const std::string& bool_expression,
const base::TimeDelta& timeout,
content::WebContents* web_contents) { … }
void XrBrowserTestBase::PollJavaScriptBooleanOrFail(
const std::string& bool_expression,
const base::TimeDelta& timeout,
content::WebContents* web_contents) { … }
void XrBrowserTestBase::BlockOnCondition(
base::RepeatingCallback<bool()> condition,
bool* result,
base::RunLoop* wait_loop,
const base::Time& start_time,
const base::TimeDelta& timeout,
const base::TimeDelta& period) { … }
void XrBrowserTestBase::WaitOnJavaScriptStep(
content::WebContents* web_contents) { … }
void XrBrowserTestBase::ExecuteStepAndWait(const std::string& step_function,
content::WebContents* web_contents) { … }
XrBrowserTestBase::TestStatus XrBrowserTestBase::CheckTestStatus(
content::WebContents* web_contents) { … }
void XrBrowserTestBase::EndTest(content::WebContents* web_contents) { … }
void XrBrowserTestBase::AssertNoJavaScriptErrors(
content::WebContents* web_contents) { … }
void XrBrowserTestBase::RunJavaScriptOrFail(const std::string& js_expression) { … }
bool XrBrowserTestBase::RunJavaScriptAndExtractBoolOrFail(
const std::string& js_expression) { … }
std::string XrBrowserTestBase::RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression) { … }
bool XrBrowserTestBase::PollJavaScriptBoolean(
const std::string& bool_expression,
const base::TimeDelta& timeout) { … }
void XrBrowserTestBase::PollJavaScriptBooleanOrFail(
const std::string& bool_expression,
const base::TimeDelta& timeout) { … }
void XrBrowserTestBase::WaitOnJavaScriptStep() { … }
void XrBrowserTestBase::ExecuteStepAndWait(const std::string& step_function) { … }
void XrBrowserTestBase::EndTest() { … }
void XrBrowserTestBase::AssertNoJavaScriptErrors() { … }
void XrBrowserTestBase::LogJavaScriptFailure() { … }
}