Commit 800f506a authored by bsheedy's avatar bsheedy Committed by Commit Bot

VR Browser Test Refactor Part 2: Additional Cleanup

Makes the following changes to the VR browser tests to bring them more
in line with the Java implementation:

* Renames "webvr_*browser_test.cc" to "webxr_vr_*browser_test.cc"
* Adds some missing functions such as "PollJavaScriptBooleanOrFail"
* Adds failure messages to all asserts
* Standardizes function ordering
* Spelling/punctuation fixes
* Updates the Markdown documentation
* Renames the "vr_browser_tests" test suite to "xr_browser_tests"

Bug: 868143
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I4ec82eaed3101667cc7574fd0df81aa5d1ce155b
Reviewed-on: https://chromium-review.googlesource.com/1157697
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581072}
parent 542cab3c
......@@ -19,25 +19,25 @@ void WebVrBrowserTestBase::EnterSessionWithUserGesture(
// ExecuteScript runs with a user gesture, so we can just directly call
// requestPresent instead of having to do the hacky workaround the
// instrumentation tests use of actually sending a click event to the canvas.
EXPECT_TRUE(content::ExecuteScript(web_contents, "onVrRequestPresent()"));
RunJavaScriptOrFail("onVrRequestPresent()", web_contents);
}
void WebVrBrowserTestBase::EnterSessionWithUserGestureOrFail(
content::WebContents* web_contents) {
EnterSessionWithUserGesture(web_contents);
EXPECT_TRUE(PollJavaScriptBoolean("vrDisplay.isPresenting", kPollTimeoutLong,
web_contents));
PollJavaScriptBooleanOrFail("vrDisplay.isPresenting", kPollTimeoutLong,
web_contents);
}
void WebVrBrowserTestBase::EndSession(content::WebContents* web_contents) {
EXPECT_TRUE(content::ExecuteScript(web_contents, "vrDisplay.exitPresent()"));
RunJavaScriptOrFail("vrDisplay.exitPresent()", web_contents);
}
void WebVrBrowserTestBase::EndSessionOrFail(
content::WebContents* web_contents) {
EndSession(web_contents);
EXPECT_TRUE(PollJavaScriptBoolean("vrDisplay.isPresenting == false",
kPollTimeoutLong, web_contents));
PollJavaScriptBooleanOrFail("vrDisplay.isPresenting == false",
kPollTimeoutLong, web_contents);
}
} // namespace vr
......@@ -11,6 +11,12 @@ bool WebXrBrowserTestBase::XrDeviceFound(content::WebContents* web_contents) {
return RunJavaScriptAndExtractBoolOrFail("xrDevice != null", web_contents);
}
void WebXrBrowserTestBase::EnterSessionWithUserGestureAndWait(
content::WebContents* web_contents) {
EnterSessionWithUserGesture(web_contents);
WaitOnJavaScriptStep(web_contents);
}
bool WebXrBrowserTestBase::XrDeviceFound() {
return XrDeviceFound(GetFirstTabWebContents());
}
......@@ -19,12 +25,6 @@ void WebXrBrowserTestBase::EnterSessionWithUserGesture() {
EnterSessionWithUserGesture(GetFirstTabWebContents());
}
void WebXrBrowserTestBase::EnterSessionWithUserGestureAndWait(
content::WebContents* web_contents) {
EnterSessionWithUserGesture(web_contents);
WaitOnJavaScriptStep(web_contents);
}
void WebXrBrowserTestBase::EnterSessionWithUserGestureAndWait() {
EnterSessionWithUserGestureAndWait(GetFirstTabWebContents());
}
......
......@@ -16,47 +16,47 @@ class WebXrBrowserTestBase : public XrBrowserTestBase {
// Checks whether an XRDevice was actually found.
virtual bool XrDeviceFound(content::WebContents* web_contents);
// Convenience function for calling XrDeviceFound with the return value of
// GetFirstTabWebContents.
bool XrDeviceFound();
// Enters a WebXR or WebVR session of some kind.
virtual void EnterSessionWithUserGesture(
content::WebContents* web_contents) = 0;
// Convenience function for calling EnterSessionWithUserGesture with the
// return value of GetFirstTabWebContents.
void EnterSessionWithUserGesture();
// Enters a WebXR or WebVR session of some kind and waits until the page
// page reports it is finished with its JavaScript step.
void EnterSessionWithUserGestureAndWait(content::WebContents* web_contents);
// Convenience function for calling EnterSessionWithUserGestureAndWait with
// the return value of GetFirstTabWebContents.
void EnterSessionWithUserGestureAndWait();
// Attempts to enter a WebXR or WebVR session of some kind, failing if it is
// unable to.
virtual void EnterSessionWithUserGestureOrFail(
content::WebContents* web_contents) = 0;
// Convenience function for calling EnterSessionWithUserGestureOrFail with the
// return value of GetFirstTabWebContents.
void EnterSessionWithUserGestureOrFail();
// Ends whatever type of session a subclass enters with
// EnterSessionWithUserGesture.
virtual void EndSession(content::WebContents* web_contents) = 0;
// Convenience function for calling EndSession with the return value of
// GetFirstTabWebContents.
void EndSession();
// Attempts to end whatever type of session a subclass enters with
// EnterSessionWithUserGesture, failing if it is unable to.
virtual void EndSessionOrFail(content::WebContents* web_contents) = 0;
// Convenience function for calling XrDeviceFound with the return value of
// GetFirstTabWebContents.
bool XrDeviceFound();
// Convenience function for calling EnterSessionWithUserGesture with the
// return value of GetFirstTabWebContents.
void EnterSessionWithUserGesture();
// Convenience function for calling EnterSessionWithUserGestureAndWait with
// the return value of GetFirstTabWebContents.
void EnterSessionWithUserGestureAndWait();
// Convenience function for calling EnterSessionWithUserGestureOrFail with the
// return value of GetFirstTabWebContents.
void EnterSessionWithUserGestureOrFail();
// Convenience function for calling EndSession with the return value of
// GetFirstTabWebContents.
void EndSession();
// Convenience function for calling EndSessionOrFail with the return value of
// GetFirstTabWebContents.
void EndSessionOrFail();
......
......@@ -15,29 +15,29 @@ void WebXrVrBrowserTestBase::EnterSessionWithUserGesture(
// ExecuteScript runs with a user gesture, so we can just directly call
// requestSession instead of having to do the hacky workaround the
// instrumentation tests use of actually sending a click event to the canvas.
EXPECT_TRUE(content::ExecuteScript(web_contents, "onRequestSession()"));
RunJavaScriptOrFail("onRequestSession()", web_contents);
}
void WebXrVrBrowserTestBase::EnterSessionWithUserGestureOrFail(
content::WebContents* web_contents) {
EnterSessionWithUserGesture(web_contents);
EXPECT_TRUE(PollJavaScriptBoolean(
PollJavaScriptBooleanOrFail(
"sessionInfos[sessionTypes.IMMERSIVE].currentSession != null",
kPollTimeoutLong, web_contents));
kPollTimeoutLong, web_contents);
}
void WebXrVrBrowserTestBase::EndSession(content::WebContents* web_contents) {
EXPECT_TRUE(content::ExecuteScript(
web_contents,
"sessionInfos[sessionTypes.IMMERSIVE].currentSession.end()"));
RunJavaScriptOrFail(
"sessionInfos[sessionTypes.IMMERSIVE].currentSession.end()",
web_contents);
}
void WebXrVrBrowserTestBase::EndSessionOrFail(
content::WebContents* web_contents) {
EndSession(web_contents);
EXPECT_TRUE(PollJavaScriptBoolean(
PollJavaScriptBooleanOrFail(
"sessionInfos[sessionTypes.IMMERSIVE].currentSession == null",
kPollTimeoutLong, web_contents));
kPollTimeoutLong, web_contents);
}
} // namespace vr
This diff is collapsed.
......@@ -36,6 +36,8 @@ class XrBrowserTestBase : public InProcessBrowserTest {
base::TimeDelta::FromMilliseconds(1000);
static constexpr base::TimeDelta kPollTimeoutLong =
base::TimeDelta::FromMilliseconds(10000);
// Still considered XR-wide instead of VR-specific since OpenVR can be used
// for passthrough AR with certain headsets.
static constexpr char kVrOverrideEnvVar[] = "VR_OVERRIDE";
static constexpr char kVrOverrideVal[] = "./mock_vr_clients/";
static constexpr char kVrConfigPathEnvVar[] = "VR_CONFIG_PATH";
......@@ -53,8 +55,8 @@ class XrBrowserTestBase : public InProcessBrowserTest {
void SetUp() override;
// Returns a GURL to the VR test HTML file of the given name, e.g.
// GetHtmlTestFile("foo") returns a GURL for the foo.html file in the VR
// Returns a GURL to the XR test HTML file of the given name, e.g.
// GetHtmlTestFile("foo") returns a GURL for the foo.html file in the XR
// test HTML directory.
GURL GetHtmlTestFile(const std::string& test_name);
......@@ -66,19 +68,23 @@ class XrBrowserTestBase : public InProcessBrowserTest {
// signalled that pre-test initialization is complete.
void LoadUrlAndAwaitInitialization(const GURL& url);
// Retrieves the current status of the JavaScript test and returns an enum
// corresponding to it.
TestStatus CheckTestStatus(content::WebContents* web_contents);
// Convenience function for ensuring the given JavaScript runs successfully
// without having to always surround in EXPECT_TRUE.
void RunJavaScriptOrFail(const std::string& js_expression,
content::WebContents* web_contents);
// Asserts that the JavaScript test code completed successfully.
void EndTest(content::WebContents* web_contents);
// Convenience function for ensuring ExecuteScriptAndExtractBool runs
// successfully and for directly getting the result instead of needing to pass
// a pointer to be filled.
bool RunJavaScriptAndExtractBoolOrFail(const std::string& js_expression,
content::WebContents* web_contents);
// Asserts that the JavaScript test harness did not detect any failures.
// Similar to EndTest, but does not fail if the test is still detected as
// running. This is useful because not all tests make use of the test harness'
// test/assert features, but may still want to ensure that no unexpected
// JavaScript errors were encountered.
void AssertNoJavaScriptErrors(content::WebContents* web_contents);
// Convenience function for ensuring ExecuteScripteAndExtractString runs
// successfully and for directly getting the result instead of needing to pass
// a pointer to be filled.
std::string RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression,
content::WebContents* web_contents);
// Blocks until the given JavaScript expression evaluates to true or the
// timeout is reached. Returns true if the expression evaluated to true or
......@@ -87,14 +93,11 @@ class XrBrowserTestBase : public InProcessBrowserTest {
const base::TimeDelta& timeout,
content::WebContents* web_contents);
// Blocks until the JavaScript in the given WebContents signals that it is
// finished.
void WaitOnJavaScriptStep(content::WebContents* web_contents);
// Executes the given step/JavaScript expression and blocks until JavaScript
// signals that it is finished.
void ExecuteStepAndWait(const std::string& step_function,
content::WebContents* web_contents);
// Polls the provided JavaScript boolean expression, failing the test if it
// does not evaluate to true within the provided timeout.
void PollJavaScriptBooleanOrFail(const std::string& bool_expression,
const base::TimeDelta& timeout,
content::WebContents* web_contents);
// Blocks until the given callback returns true or the timeout is reached.
// Returns true if the condition successfully resolved or false on timeout.
......@@ -107,52 +110,69 @@ class XrBrowserTestBase : public InProcessBrowserTest {
const base::TimeDelta& timeout = kPollTimeoutLong,
const base::TimeDelta& period = kPollCheckIntervalLong);
// Convenience function for ensuring ExecuteScriptAndExtractBool runs
// successfully and for directly getting the result instead of needing to pass
// a pointer to be filled.
bool RunJavaScriptAndExtractBoolOrFail(const std::string& js_expression,
content::WebContents* web_contents);
// Blocks until the JavaScript in the given WebContents signals that it is
// finished.
void WaitOnJavaScriptStep(content::WebContents* web_contents);
// Convenience function for ensuring ExecuteScripteAndExtractString runs
// successfully and for directly getting the result instead of needing to pass
// a pointer to be filled.
std::string RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression,
content::WebContents* web_contents);
// Executes the given step/JavaScript expression and blocks until JavaScript
// signals that it is finished.
void ExecuteStepAndWait(const std::string& step_function,
content::WebContents* web_contents);
// Retrieves the current status of the JavaScript test and returns an enum
// corresponding to it.
TestStatus CheckTestStatus(content::WebContents* web_contents);
// Asserts that the JavaScript test code completed successfully.
void EndTest(content::WebContents* web_contents);
// Asserts that the JavaScript test harness did not detect any failures.
// Similar to EndTest, but does not fail if the test is still detected as
// running. This is useful because not all tests make use of the test harness'
// test/assert features, but may still want to ensure that no unexpected
// JavaScript errors were encountered.
void AssertNoJavaScriptErrors(content::WebContents* web_contents);
Browser* browser() { return InProcessBrowserTest::browser(); }
// Convenience function for running the static EndTest with the return value
// Convenience function for running RunJavaScriptOrFail with the return value
// of GetFirstTabWebContents.
void EndTest();
void RunJavaScriptOrFail(const std::string& js_expression);
// Convenience function for running RunJavaScriptAndExtractBoolOrFail with the
// return value of GetFirstTabWebContents.
bool RunJavaScriptAndExtractBoolOrFail(const std::string& js_expression);
// Convenience function for running the static AssertNoJavaScriptErrors with
// Convenience function for running RunJavaScriptAndExtractStringOrFail with
// the return value of GetFirstTabWebContents.
void AssertNoJavaScriptErrors();
std::string RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression);
// Convenience function for running the static PollJavaScriptBoolean with the
// return value of GetFirstTabWebContents.
// Convenience function for running PollJavaScriptBoolean with the return
// value of GetFirstTabWebContents.
bool PollJavaScriptBoolean(const std::string& bool_expression,
const base::TimeDelta& timeout);
// Convenience function for running the static WaitOnJavaScriptStep with the
// Convenience function for running PollJavaScriptBooleanOrFail with the
// return value of GetFirstTabWebContents.
void PollJavaScriptBooleanOrFail(const std::string& bool_expression,
const base::TimeDelta& timeout);
// Convenience function for running WaitOnJavaScriptStep with the return value
// of GetFirstTabWebContents.
void WaitOnJavaScriptStep();
// Convenience function for running the static ExecuteStepAndWait with the
// return value of GetFirstTabWebContents.
// Convenience function for running ExecuteStepAndWait with the return value
// of GetFirstTabWebContents.
void ExecuteStepAndWait(const std::string& step_function);
// Convenience function for running the static
// RunJavaScriptAndExtractBoolOrFail with the return value of
// Convenience function for running EndTest with the return value of
// GetFirstTabWebContents.
bool RunJavaScriptAndExtractBoolOrFail(const std::string& js_expression);
void EndTest();
// Convenience function for running the static
// RunJavaScriptAndExtractStringOrFail with the return value of
// GetFirstTabWebContents.
std::string RunJavaScriptAndExtractStringOrFail(
const std::string& js_expression);
// Convenience function for running AssertNoJavaScriptErrors with the return
// value of GetFirstTabWebContents.
void AssertNoJavaScriptErrors();
protected:
std::unique_ptr<base::Environment> env_;
......
# VR Browser Tests
# XR Browser Tests
## Introduction
This documentation concerns `vr_browser_test.h`, `vr_browser_test.cc`, and files
that use them.
This documentation concerns `xr_browser_test.h`, `xr_browser_test.cc`, and files
that use them or their subclasses.
These files port the framework used by VR instrumentation tests (located in
`//chrome/android/javatests/src/org/chromium/chrome/browser/vr/` and
These files port the framework used by XR instrumentation tests (located in
[`//chrome/android/javatests/src/org/chromium/chrome/browser/vr/`][1] and
documented in
`//chrome/android/javatests/src/org/chromium/chrome/browser/vr/*.md`) for
use in browser tests in order to test VR features on desktop platforms.
use in browser tests in order to test XR features on desktop platforms.
This is pretty much a direct port, with the same JavaScript/HTML files being
used for both and the Java/C++ code being functionally equivalent to each other,
so the instrumentation test's documentation on writing tests using the framework
is applicable here, too. As such, this documentation covers any notable
is applicable here, too. As such, this documentation only covers any notable
differences between the two implementations.
## Restrictions
Both the instrumentation tests and browser tests have hardware/software
restrictions - in the case of browser tests, VR is only supported on Windows 8
restrictions - in the case of browser tests, XR is only supported on Windows 8
and later (or Windows 7 with a non-standard patch applied) with a GPU that
supports DirectX 11.1.
Instrumentation tests handle restrictions with the `@Restriction` annotation,
but browser tests don't have any equivalent functionality. Instead, test names
should be wrapped in the REQUIRES_GPU macro defined in `vr_browser_test.h`,
should be wrapped in the `REQUIRES_GPU` macro defined in `xr_browser_test.h`,
which simply disables the test by default. We then explicitly run tests that
inherit from `VrBrowserTest` and enable the running of disabled tests on bots
that meet the requirements.
inherit from `XrBrowserTestBase` and enable the running of disabled tests on
bots that meet the requirements.
## Command Line Switches
......@@ -38,5 +38,22 @@ per-test-case basis using `@CommandLine` annotations, but equivalent
functionality does not exist in browser tests.
Instead, if different command line flags are needed, a new class will need to
be created that extends `VrBrowserTest` and overrides the flags that are set
in its `SetUp` function.
\ No newline at end of file
be created that extends the correct type of `*BrowserTestBase` and overrides the
flags that are set in its `SetUp` function.
## Compiling And Running
The tests are compiled as part of the standard `browser_tests` target, although
the files are currently only included on Windows.
Once compiled, the tests can be run using the following command line, which
ensures that only the XR browser tests are run:
`browser_tests.exe --enable-gpu --test-launcher-jobs=1
--gtest_filter=WebVrBrowserTest*:WebXrVrBrowserTest*
--enable-pixel-output-in-tests --gtest_also_run_disabled_tests`
Note that this must be run from your output directory, e.g. `out/Debug`, as
otherwise the setup code to use the mock OpenVR client will fail.
[1]: https://chromium.googlesource.com/chromium/src/+/master/chrome/android/javatests/src/org/chromium/chrome/browser/vr
\ No newline at end of file
......@@ -81,7 +81,8 @@ void MyOpenVRMock::OnFrameSubmitted(device::SubmittedFrameData frame_data) {
wait_loop_ = nullptr;
}
EXPECT_TRUE(has_last_immersive_frame_data_);
EXPECT_TRUE(has_last_immersive_frame_data_)
<< "Frame submitted without any frame data provided";
// We expect a waitGetPoses, then 2 submits (one for each eye), so after 2
// submitted frames don't use the same frame_data again.
......@@ -148,7 +149,7 @@ void TestPresentationPosesImpl(WebXrVrBrowserTestBase* t,
t->LoadUrlAndAwaitInitialization(t->GetHtmlTestFile(filename));
t->EnterSessionWithUserGestureOrFail();
// Wait for javascript to submit at least one frame.
// Wait for JavaScript to submit at least one frame.
EXPECT_TRUE(
t->PollJavaScriptBoolean("hasPresentedFrame", t->kPollTimeoutShort))
<< "No frame submitted";
......@@ -180,28 +181,32 @@ void TestPresentationPosesImpl(WebXrVrBrowserTestBase* t,
// Validate that each frame is only seen once for each eye.
DLOG(ERROR) << "Frame id: " << frame_id;
if (data.left_eye) {
EXPECT_TRUE(seen_left.find(frame_id) == seen_left.end());
EXPECT_TRUE(seen_left.find(frame_id) == seen_left.end())
<< "Frame for left eye submitted more than once";
seen_left.insert(frame_id);
} else {
EXPECT_TRUE(seen_right.find(frame_id) == seen_right.end());
EXPECT_TRUE(seen_right.find(frame_id) == seen_right.end())
<< "Frame for right eye submitted more than once";
seen_right.insert(frame_id);
}
// Validate that frames arrive in order.
EXPECT_TRUE(frame_id >= max_frame_id);
EXPECT_TRUE(frame_id >= max_frame_id) << "Frame received out of order";
max_frame_id = std::max(frame_id, max_frame_id);
// Validate that the javascript-side cache of frames contains our submitted
// Validate that the JavaScript-side cache of frames contains our submitted
// frame.
EXPECT_TRUE(t->RunJavaScriptAndExtractBoolOrFail(
base::StringPrintf("checkFrameOccurred(%d)", frame_id)));
base::StringPrintf("checkFrameOccurred(%d)", frame_id)))
<< "JavaScript-side frame cache does not contain submitted frame";
// Validate that the javascript-side cache of frames has the correct pose.
// Validate that the JavaScript-side cache of frames has the correct pose.
EXPECT_TRUE(t->RunJavaScriptAndExtractBoolOrFail(base::StringPrintf(
"checkFramePose(%d, %s)", frame_id, GetPoseAsString(frame).c_str())));
"checkFramePose(%d, %s)", frame_id, GetPoseAsString(frame).c_str())))
<< "JavaScript-side frame cache has incorrect pose";
}
// Tell javascript that it is done with the test.
// Tell JavaScript that it is done with the test.
t->ExecuteStepAndWait("finishTest()");
t->EndTest();
}
......
......@@ -7,7 +7,7 @@
// Browser test equivalent of
// chrome/android/javatests/src/.../browser/vr/WebXrVrInputTest.java.
// End-to-end tests for user input interaction with WebVR.
// End-to-end tests for user input interaction with WebXR/WebVR.
namespace vr {
......
......@@ -56,22 +56,26 @@ void TestPresentationPixelsImpl(WebXrVrBrowserTestBase* t,
t->LoadUrlAndAwaitInitialization(t->GetHtmlTestFile(filename));
t->EnterSessionWithUserGestureOrFail();
// Wait for javascript to submit at least one frame.
// Wait for JavaScript to submit at least one frame.
EXPECT_TRUE(
t->PollJavaScriptBoolean("hasPresentedFrame", t->kPollTimeoutShort))
<< "No frame submitted";
// Tell javascript that it is done with the test.
// Tell JavaScript that it is done with the test.
t->ExecuteStepAndWait("finishTest()");
t->EndTest();
my_mock.WaitForFrame();
device::Color expected = {0, 0, 255, 255};
EXPECT_EQ(expected.r, my_mock.last_submitted_color_.r);
EXPECT_EQ(expected.g, my_mock.last_submitted_color_.g);
EXPECT_EQ(expected.b, my_mock.last_submitted_color_.b);
EXPECT_EQ(expected.a, my_mock.last_submitted_color_.a);
EXPECT_EQ(expected.r, my_mock.last_submitted_color_.r)
<< "Red channel of submitted color does not match expectation";
EXPECT_EQ(expected.g, my_mock.last_submitted_color_.g)
<< "Green channel of submitted color does not match expectation";
EXPECT_EQ(expected.b, my_mock.last_submitted_color_.b)
<< "Blue channel of submitted color does not match expectation";
EXPECT_EQ(expected.a, my_mock.last_submitted_color_.a)
<< "Alpha channel of submitted color does not match expectation";
}
IN_PROC_BROWSER_TEST_F(WebVrBrowserTestStandard,
......
......@@ -10,11 +10,11 @@
// Browser test equivalent of
// chrome/android/javatests/src/.../browser/vr/WebXrVrTabTest.java.
// End-to-end tests for testing WebVR's interaction with multiple tabss.
// End-to-end tests for testing WebXR/WebVR's interaction with multiple tabs.
namespace vr {
// Tests that non-focused tabs cannot get pose information from WebVR/WebXR
// Tests that non-focused tabs cannot get pose information from WebVR/WebXR.
void TestPoseDataUnfocusedTabImpl(WebXrVrBrowserTestBase* t,
std::string filename) {
t->LoadUrlAndAwaitInitialization(t->GetHtmlTestFile(filename));
......
......@@ -8,17 +8,18 @@
// Browser test equivalent of
// chrome/android/javatests/src/.../browser/vr/WebXrVrTransitionTest.java.
// End-to-end tests for transitioning between WebVR's magic window and
// presentation modes.
// End-to-end tests for transitioning between immersive and non-immersive
// sessions.
namespace vr {
// Tests that a successful requestPresent or requestSession call enters
// presentation.
// an immersive session.
void TestPresentationEntryImpl(WebXrVrBrowserTestBase* t,
std::string filename) {
t->LoadUrlAndAwaitInitialization(t->GetHtmlTestFile(filename));
t->EnterSessionWithUserGestureOrFail();
t->AssertNoJavaScriptErrors();
}
IN_PROC_BROWSER_TEST_F(WebVrBrowserTestStandard,
......@@ -80,7 +81,8 @@ IN_PROC_BROWSER_TEST_F(WebXrVrBrowserTestWebXrDisabled,
IN_PROC_BROWSER_TEST_F(WebVrBrowserTestOpenVrDisabled,
TestWebVrNoDevicesWithoutOpenVr) {
LoadUrlAndAwaitInitialization(GetHtmlTestFile("generic_webvr_page"));
EXPECT_FALSE(XrDeviceFound());
EXPECT_FALSE(XrDeviceFound())
<< "Found a VRDisplay even with OpenVR disabled";
AssertNoJavaScriptErrors();
}
......@@ -95,7 +97,7 @@ IN_PROC_BROWSER_TEST_F(WebXrVrBrowserTestOpenVrDisabled,
}
// Tests that window.requestAnimationFrame continues to fire when we have a
// non-immersive WebXR session
// non-immersive WebXR session.
IN_PROC_BROWSER_TEST_F(
WebXrVrBrowserTestStandard,
REQUIRES_GPU(TestWindowRafFiresDuringNonImmersiveSession)) {
......
......@@ -1994,11 +1994,11 @@ test("browser_tests") {
"../browser/vr/test/webxr_vr_browser_test.h",
"../browser/vr/test/xr_browser_test.cc",
"../browser/vr/test/xr_browser_test.h",
"../browser/vr/webvr_frame_pose_browser_test.cc",
"../browser/vr/webvr_input_browser_test.cc",
"../browser/vr/webvr_pixel_browser_test.cc",
"../browser/vr/webvr_tab_browser_test.cc",
"../browser/vr/webvr_transition_browser_test.cc",
"../browser/vr/webxr_vr_frame_pose_browser_test.cc",
"../browser/vr/webxr_vr_input_browser_test.cc",
"../browser/vr/webxr_vr_pixel_browser_test.cc",
"../browser/vr/webxr_vr_tab_browser_test.cc",
"../browser/vr/webxr_vr_transition_browser_test.cc",
]
deps += [
"//chrome:other_version",
......
......@@ -11064,7 +11064,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -11433,7 +11433,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -12029,7 +12029,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -12699,6 +12699,28 @@
},
"test": "browser_tests"
},
{
"args": [
"--enable-gpu",
"--test-launcher-bot-mode",
"--test-launcher-jobs=1",
"--gtest_filter=WebVrBrowserTest*:WebXrVrBrowserTest*",
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"gpu": "8086:5912-24.20.100.6025",
"os": "Windows-10",
"pool": "Chrome-GPU"
}
]
},
"test": "browser_tests"
},
{
"args": [
"--use-gpu-in-tests",
......@@ -13351,7 +13373,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -14082,7 +14104,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -16062,6 +16084,28 @@
},
"test": "browser_tests"
},
{
"args": [
"--enable-gpu",
"--test-launcher-bot-mode",
"--test-launcher-jobs=1",
"--gtest_filter=WebVrBrowserTest*:WebXrVrBrowserTest*",
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"gpu": "1002:6613",
"os": "Windows-2008ServerR2-SP1",
"pool": "Chrome-GPU"
}
]
},
"test": "browser_tests"
},
{
"args": [
"--use-gpu-in-tests",
......
......@@ -2295,7 +2295,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......@@ -2730,7 +2730,7 @@
"--enable-pixel-output-in-tests",
"--gtest_also_run_disabled_tests"
],
"name": "vr_browser_tests",
"name": "xr_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
......
......@@ -1417,18 +1417,7 @@
'Win10 Tests x64',
],
},
'vr_browser_tests': {
'remove_from': [
# chromium.gpu.fyi
# TODO(kbr): remove the following two exceptions after switching
# to the new generate_buildbot_json script.
'Win10 FYI Exp Release (Intel HD 630)',
'Win7 FYI Release (AMD)',
# This exception probably needs to stay due to lack of capacity
# on the Win AMD bots.
'Win7 FYI Debug (AMD)',
],
},
'vr_pixeltests': {
'remove_from': [
# chromium.fyi
......@@ -1819,4 +1808,12 @@
},
},
},
'xr_browser_tests': {
'remove_from': [
# chromium.gpu.fyi
# This exception probably needs to stay due to lack of capacity
# on the Win AMD bots.
'Win7 FYI Debug (AMD)',
],
},
}
......@@ -1240,7 +1240,7 @@
},
'gpu_default_and_optional_win_specific_gtests': {
'vr_browser_tests': {
'xr_browser_tests': {
'args': [
'--enable-gpu',
'--test-launcher-bot-mode',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment