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

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

Issue 2617183002: Add more WebVR layout tests, adjust test format (Closed)
Patch Set: Add some missing catches for failed getVRDisplays 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/exitPresent_reject_notpresenting.html
diff --git a/third_party/WebKit/LayoutTests/vr/exitPresent_reject_notpresenting.html b/third_party/WebKit/LayoutTests/vr/exitPresent_reject_notpresenting.html
new file mode 100644
index 0000000000000000000000000000000000000000..3ab5bd79b77867e787e29ff6cc5c57028e34f779
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/vr/exitPresent_reject_notpresenting.html
@@ -0,0 +1,42 @@
+<!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) => {
+ t.step( () => {
+ assert_true(displays != null);
+ assert_equals(1, displays.length);
+ }, "getVRDisplays returned correct results");
+ var display = displays[0];
+
+ return display.exitPresent().then( () => {
+ t.step( () => {
+ assert_unreached();
+ }, "requestPresent succeeded unexpectedly");
bajones 2017/01/06 20:20:25 Should be exitPresent
bsheedy 2017/01/06 22:14:18 Done.
+ }, (err) => {
+ t.step( () => {
+ assert_true(err instanceof DOMException);
+ assert_equals(err.name, "InvalidStateError");
+ assert_false(display.isPresenting);
+ }, "Request rejected properly");
+ }).then( () => {
+ t.done();
+ });
+ }, (err) => {
+ t.step( () => {
+ assert_unreached(err);
+ }, "getVRDisplays rejected");
+ t.done()
+ });
+}, [fakeDisplays["Pixel"]],
+"Test exitPresent rejects if not presenting");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698