Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <!DOCTYPE HTML>
2 <html>
3 <!--https://bugzilla.mozilla.org/show_bug.cgi?id=633602-->
4 <head>
5 <title>Bug 633602</title>
6 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
7 </script>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
9 </script>
10 <script type="application/javascript" src="pointerlock_utils.js"></script>
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12 </head>
13 <body>
14 <a target="_blank"
15 href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
16 Mozilla Bug 633602
17 </a>
18 <div id="div"></div>
19 <pre id="test">
20 <script type="text/javascript">
21 /*
22 * Test for Bug 633602
23 * Escape key should unlock the pointer
24 */
26 SimpleTest.waitForExplicitFinish();
28 var div = document.getElementById("div")
29 , pointerUnLocked = false;
31 function runTests () {
32 ok(pointerUnLocked, "Pressing Escape key should unlock the pointer");
33 }
35 document.addEventListener("mozpointerlockchange", function (e) {
36 if (document.mozPointerLockElement === div) {
37 synthesizeKey("VK_ESCAPE", {});
38 }
39 else {
40 pointerUnLocked = true;
41 document.mozCancelFullScreen();
42 }
43 }, false);
45 document.addEventListener("mozfullscreenchange", function(e) {
46 if (document.mozFullScreenElement === div) {
47 div.mozRequestPointerLock();
48 }
49 else {
50 runTests();
51 SimpleTest.finish();
52 }
53 }, false);
55 function start() {
56 div.mozRequestFullScreen();
57 }
58 </script>
59 </pre>
60 </body>
61 </html>