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

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

Issue 2624263003: Add more WebVR layout tests and fix small issues they found (Closed)
Patch Set: Added a few clarifying comments 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_then_reject.html
diff --git a/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_then_reject.html b/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_then_reject.html
new file mode 100644
index 0000000000000000000000000000000000000000..043a71b53d8378f6368bf90ce3e4129d489454a4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_then_reject.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/fake-vr-displays.js"></script>
+<script src="resources/mock-vr-service.js"></script>
+<canvas id="webgl-canvas"></canvas>
+<script src="resources/presentation-setup.js"></script>
+<script>
+let fakeDisplays = fakeVRDisplays();
+
+vr_test( (t) => {
+ return navigator.getVRDisplays().then( (displays) => {
+ var display = displays[0];
+
+ runWithUserGesture( () => {
+ display.requestPresent([{ source : webglCanvas }]).then( () => {
+ t.step( () => {
+ assert_true(display.isPresenting);
+ }, "Display should be presenting");
+ display.requestPresent([{ source : null }]).then( () => {
+ t.step( () => {
+ assert_unreached();
+ }, "Second requestPresent succeeded");
+ }, (err) => {
+ t.step( () => {
+ assert_false(display.isPresenting);
+ }, "Should no longer be presenting");
+ }).then( () => {
+ t.done();
+ });
+ }, (err) => {
+ t.step( () => {
+ assert_unreached(err);
+ }, "requestPresent rejected");
+ t.done();
+ });
+ });
+ }, (err) => {
+ t.step( () => {
+ assert_unreached();
+ }, "getVRDisplays rejected");
+ t.done();
+ });
+}, [fakeDisplays["Pixel"]],
+"Test display stops presenting if requestPresent rejects");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698