summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html')
-rw-r--r--testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html85
1 files changed, 85 insertions, 0 deletions
diff --git a/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html b/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
new file mode 100644
index 000000000..198e2fe63
--- /dev/null
+++ b/testing/web-platform/tests/pointerlock/pointerlock_leave_Tab-manual.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='interact'>
+<meta name="timeout" content="long">
+<style type="text/css">
+ button {
+ color: blue;
+ }
+
+ #target-wrap {
+ position: relative;
+ background-color: lightgrey;
+ width: 200px;
+ height: 100px;
+ border: grey 1px solid;
+ }
+
+ #target {
+ position: relative;
+ background-color: lightyellow;
+ width: 100px;
+ height: 30px;
+ border: yellow 1px solid;
+ }
+
+ #status-log {
+ margin: 10px 0;
+ color: green;
+ }
+</style>
+</head>
+<body>
+ <h2>Description</h2>
+ <p>This test validates that pointer lock will be lost the user agent / window loses focus.</p>
+ <hr/>
+
+ <h2>Manual Test Steps:</h2>
+ <p>
+ <ol>
+ <li>Click the "lockTarget" button to request a pointer lock.</li>
+ <li>Focus to another tab with keyboard (Ctrl-TAB).</li>
+ <li>Test is done.</li>
+ </ol>
+ </p>
+ <hr/>
+
+ <button onclick="lockTarget();">lockTarget</button>
+
+ <div id="target-wrap">
+ <div id="status-log">Click the "lockTarget" button.</div>
+ <div id="target">Target</div>
+ </div>
+ <hr/>
+
+ <div id="log"></div>
+
+ <script type="text/javascript" >
+ var target = document.querySelector('#target'),
+ status_log = document.querySelector('#status-log');
+
+ var leaveTabTest = async_test("Test that pointer lock will be lost when the current Tab loses focus.");
+
+ document.addEventListener("pointerlockchange", function() {
+ if(document.pointerLockElement) {
+ status_log.innerHTML = "Please leave the current tab.";
+ } else {
+ status_log.innerHTML = "Pointer lock exited!";
+
+ leaveTabTest.step(function() {
+ assert_true(document.pointerLockElement === null, "Pointer lock exited!");
+ });
+
+ leaveTabTest.done();
+ }
+ });
+
+ function lockTarget() {
+ target.requestPointerLock();
+ }
+ </script>
+ </body>
+</html>