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

Side by Side Diff: LayoutTests/fullscreen/full-screen-keyboard-enabled.html

Issue 462253003: Remove early returns in fullscreen tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <body> 1 <body>
2 <script src="full-screen-test.js"></script> 2 <script src="full-screen-test.js"></script>
3 <p>This tests that full screen mode does not allow alphanumeric key events. Pre ss space to continue, then press the 'a' key. 3 <p>This tests that full screen mode does not allow alphanumeric key events. Pre ss space to continue, then press the 'a' key.
4 <span></span> 4 <span></span>
5 <script> 5 <script>
6 // Bail out early if the full screen API is not enabled or is missing: 6 var callback;
7 if (Element.prototype.webkitRequestFullScreen == undefined) { 7 var fullscreenChanged = function(event)
8 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined "); 8 {
9 if (callback)
10 callback(event)
11 };
12 waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
13
14 var spanEnteredFullScreen = function() {
15 callback = null;
16 testExpected("document.webkitIsFullScreen", true);
17 if (window.testRunner && eventSender.keyDown) {
18 waitForEvent(document, 'keypress', keyPressed);
19 eventSender.keyDown('a', []);
20 }
21 };
22
23 var keyPressed = function(event) {
24 testExpected('event.keyCode', 97); // 'A'
9 endTest(); 25 endTest();
10 } else { 26 }
11 var callback;
12 var fullscreenChanged = function(event)
13 {
14 if (callback)
15 callback(event)
16 };
17 waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
18 27
19 var spanEnteredFullScreen = function() { 28 var span = document.getElementsByTagName('span')[0];
20 callback = null; 29 callback = spanEnteredFullScreen;
21 testExpected("document.webkitIsFullScreen", true); 30 runWithKeyDown(function(){span.webkitRequestFullScreen(Element.ALLOW_KEYBOAR D_INPUT)});
22 if (window.testRunner && eventSender.keyDown) {
23 waitForEvent(document, 'keypress', keyPressed);
24 eventSender.keyDown('a', []);
25 }
26 };
27
28 var keyPressed = function(event) {
29 testExpected('event.keyCode', 97); // 'A'
30 endTest();
31 }
32
33 var span = document.getElementsByTagName('span')[0];
34 callback = spanEnteredFullScreen;
35 runWithKeyDown(function(){span.webkitRequestFullScreen(Element.ALLOW_KEY BOARD_INPUT)});
36 }
37 </script> 31 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fullscreen/full-screen-keyboard-disabled.html ('k') | LayoutTests/fullscreen/full-screen-line-boxes-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698