Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html

Issue 2616403002: Revert of Add more WebVR layout tests, adjust test format (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html
diff --git a/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html b/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html
index 7e381b3a3c5bc0a456501d34f655b58bb6a3784d..1f2e6d5e3557a8ae9194ab845513522ef64dcf2a 100644
--- a/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html
+++ b/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_repeatwithoutgesture.html
@@ -9,46 +9,43 @@
<script>
let fakeDisplays = fakeVRDisplays();
-vr_test( (t) => {
- return navigator.getVRDisplays().then( (displays) => {
- var display = displays[0];
+vr_test((service) => {
+ return navigator.getVRDisplays().then(displays => {
+ assert_true(displays != null);
+ assert_equals(1, displays.length);
+ var asyncTest = async_test(
+ "requestPresent resolves and actually presents");
+ runWithUserGesture( () => {
+ displays[0].requestPresent([{ source : webglCanvas }]).then( () => {
+ asyncTest.step( () => {
+ assert_true(displays[0].isPresenting);
+ }, "Display should be presenting");
- runWithUserGesture( () => {
- display.requestPresent([{ source : webglCanvas }]).then( () => {
- t.step( () => {
- assert_true(display.isPresenting);
- }, "Display should be presenting");
+ // Call requestPresent again after a short delay, but without a user
+ // gesture. Should resolve because it's already presenting.
+ setTimeout(() => {
+ displays[0].requestPresent([{ source : webglCanvas }]).then( () => {
+ asyncTest.step( () => {
+ assert_true(displays[0].isPresenting);
+ }, "Display should still be presenting");
+ }, (err) => {
+ asyncTest.step( () => {
+ assert_unreached(err);
+ }, "Should never reach here");
+ }).then( () => {
+ asyncTest.done();
+ });
+ }, 100);
- // Call requestPresent again after a short delay, but without a user
- // gesture. Should resolve because it's already presenting.
- setTimeout( () => {
- display.requestPresent([{ source : webglCanvas }]).then( () => {
- t.step( () => {
- assert_true(display.isPresenting);
- }, "Display should still be presenting");
- }, (err) => {
- t.step( () => {
- assert_unreached(err);
- }, "Should never reach here");
- }).then( () => {
- t.done();
- });
- }, 100);
-
- }, (err) => {
- t.step( () => {
- assert_unreached(err);
- }, "Should never reach here");
- t.done();
+ }, (err) => {
+ asyncTest.step( () => {
+ assert_unreached(err);
+ }, "Should never reach here");
+ asyncTest.done();
+ });
});
});
- }, (err) => {
- t.step( () => {
- assert_unreached(err);
- }, "getVRDisplays rejected");
- t.done();
- });
-}, [fakeDisplays["Pixel"]],
-"Test requestPresent resolves without a user gesture when already presenting");
+}, [fakeDisplays['Pixel']],
+'Test requestPresent resolves without a user gesture when already presenting');
</script>

Powered by Google App Engine
This is Rietveld 408576698