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

Unified Diff: LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-prefixed.html

Issue 424213007: Revert of Remove prefixed Pointer Lock API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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: LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-prefixed.html
diff --git a/LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-prefixed.html b/LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-prefixed.html
new file mode 100644
index 0000000000000000000000000000000000000000..af113f781d606d6f107d748161c5ef4be6d67f57
--- /dev/null
+++ b/LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-prefixed.html
@@ -0,0 +1,117 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness-prefixed.js"></script>
+</head>
+<body>
+<div>
+ <div id="target1"></div>
+ <div id="target2"></div>
+ <iframe id="iframe1"></iframe>
+ <iframe id="iframe2"></iframe>
+</div>
+<script>
+ description("Test expected pointerlockchange and pointerlockerror events.")
+ window.jsTestIsAsync = true;
+
+ targetDiv1 = document.getElementById("target1");
+ targetDiv2 = document.getElementById("target2");
+ targetIframe1 = document.getElementById("iframe1");
+ targetIframe2 = document.getElementById("iframe2");
+
+ // Events must not bubble from document.
+ function errorIfEventsBubble() {
+ testFailed("Events must not bubble to the window.");
+ finishJSTest();
+ }
+ window.addEventListener("webkitpointerlockchange", errorIfEventsBubble);
+ window.addEventListener("webkitpointerlockerror", errorIfEventsBubble);
+
+ todo = [
+ function () {
+ expectNoEvents("Unlock.");
+ document.webkitExitPointerLock();
+ doNextStepWithUserGesture();
+ },
+ function () {
+ expectOnlyChangeEvent("Lock targetDiv1.");
+ targetDiv1.webkitRequestPointerLock();
+ },
+ function () {
+ expectOnlyChangeEvent("Unlock again.");
+ document.webkitExitPointerLock();
+ },
+ function () {
+ expectOnlyChangeEvent("Lock targetDiv1 again.");
+ targetDiv1.webkitRequestPointerLock();
+ },
+ function () {
+ expectOnlyChangeEvent("Lock targetDiv2.");
+ targetDiv2.webkitRequestPointerLock();
+ },
+ function () {
+ expectOnlyChangeEvent("Lock targetDiv2 again.");
+ targetDiv2.webkitRequestPointerLock();
+ },
+ function () {
+ expectOnlyChangeEvent("Unlock targetDiv2.");
+ document.webkitExitPointerLock();
+ },
+ function () {
+ targetIframe1.src = "about:blank";
+ targetIframe1.onload = function () { doNextStep(); }
+ },
+ function () {
+ targetIframe2.src = "about:blank";
+ targetIframe2.onload = function () { doNextStep(); }
+ },
+ function () {
+ expectNoEvents("Lock targetIframe1.");
+ expectOnlyChangeEvent("Lock targetIframe1 (handler for iframe1).", targetIframe1.contentDocument);
+ targetIframe1.contentDocument.body.webkitRequestPointerLock();
+ },
+ function () {
+ expectNoEvents("Lock targetIframe2.");
+ expectNoEvents("Lock targetIframe2 (handler for iframe1).", targetIframe1.contentDocument);
+ expectOnlyErrorEvent("Lock targetIframe2 (handler for iframe2).", targetIframe2.contentDocument);
+ targetIframe2.contentDocument.body.webkitRequestPointerLock();
+ },
+ function () {
+ expectNoEvents("Unlock targetIframe2.");
+ expectOnlyChangeEvent("Unlock targetIframe2 (handler for iframe1).", targetIframe1.contentDocument);
+ expectNoEvents("Unlock targetIframe2 (handler for iframe2).", targetIframe2.contentDocument);
+ targetIframe1.contentDocument.webkitExitPointerLock();
+ },
+ function () {
+ shouldBeDefined("testRunner.setPointerLockWillFailSynchronously");
+ testRunner.setPointerLockWillFailSynchronously();
+ expectOnlyErrorEvent("Lock with synchronous failure.");
+ targetDiv1.webkitRequestPointerLock();
+ },
+ function () {
+ shouldBeDefined("testRunner.setPointerLockWillRespondAsynchronously");
+ shouldBeDefined("testRunner.didAcquirePointerLock");
+ shouldBeDefined("testRunner.didNotAcquirePointerLock");
+ testRunner.setPointerLockWillRespondAsynchronously();
+ expectOnlyErrorEvent("Lock with asynchronous failure.");
+ targetDiv1.webkitRequestPointerLock();
+ doNextStep();
+ },
+ function () {
+ testRunner.didNotAcquirePointerLock();
+ },
+ function () {
+ testRunner.setPointerLockWillRespondAsynchronously();
+ expectOnlyChangeEvent("Lock with asynchronous success.");
+ targetDiv1.webkitRequestPointerLock();
+ doNextStep();
+ },
+ function () {
+ testRunner.didAcquirePointerLock();
+ },
+ ];
+ doNextStep();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698