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

Side by Side Diff: LayoutTests/fullscreen/full-screen-placeholder.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script> 2 <script>
3 var runPixelTests = true; 3 var runPixelTests = true;
4 </script> 4 </script>
5 <script src="full-screen-test.js"></script> 5 <script src="full-screen-test.js"></script>
6 <style> 6 <style>
7 #float { 7 #float {
8 margin: 10px 0 0 10px; 8 margin: 10px 0 0 10px;
9 height: 50px; 9 height: 50px;
10 width: 50px; 10 width: 50px;
(...skipping 11 matching lines...) Expand all
22 background-color: lightgreen; 22 background-color: lightgreen;
23 } 23 }
24 </style> 24 </style>
25 <body> 25 <body>
26 <div>This layout test checks that the offset positions of the blue and green div s does not change when the red div enters full-screen mode. Press <button oncli ck="document.getElementById('float').webkitRequestFullScreen()">go full-screen</ a> to begin.</div> 26 <div>This layout test checks that the offset positions of the blue and green div s does not change when the red div enters full-screen mode. Press <button oncli ck="document.getElementById('float').webkitRequestFullScreen()">go full-screen</ a> to begin.</div>
27 <div id="float"></div> 27 <div id="float"></div>
28 <div id="one">One</div> 28 <div id="one">One</div>
29 <div id="clear" /> 29 <div id="clear" />
30 <span id="two">Two</span> 30 <span id="two">Two</span>
31 <script> 31 <script>
32 // Bail out early if the full screen API is not enabled or is missing: 32 var callback;
33 if (Element.prototype.webkitRequestFullScreen == undefined) { 33 var fullscreenChanged = function(event)
34 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined "); 34 {
35 endTest(); 35 if (callback)
36 } else { 36 callback(event)
37 var callback; 37 };
38 var fullscreenChanged = function(event) 38 document.onwebkitfullscreenchange = fullscreenChanged;
39 {
40 if (callback)
41 callback(event)
42 };
43 document.onwebkitfullscreenchange = fullscreenChanged;
44 39
45 var div = document.getElementById("float"); 40 var div = document.getElementById("float");
46 41
47 var divEnteredFullScreen = function() 42 var divEnteredFullScreen = function()
48 { 43 {
49 if (document.webkitCurrentFullScreenElement == div) { 44 if (document.webkitCurrentFullScreenElement == div) {
50 callback = cancelledFullScreen; 45 callback = cancelledFullScreen;
51 runWithKeyDown(function(){document.webkitCancelFullScreen()}); 46 runWithKeyDown(function(){document.webkitCancelFullScreen()});
52 } 47 }
53 }; 48 };
54 49
55 var cancelledFullScreen = function() 50 var cancelledFullScreen = function()
56 { 51 {
57 if (document.webkitCurrentFullScreenElement == null) { 52 if (document.webkitCurrentFullScreenElement == null) {
58 callback = null; 53 callback = null;
59 endTest(); 54 endTest();
60 } 55 }
61 }; 56 };
62 57
63 callback = divEnteredFullScreen; 58 callback = divEnteredFullScreen;
64 runWithKeyDown(function(){div.webkitRequestFullScreen()}); 59 runWithKeyDown(function(){div.webkitRequestFullScreen()});
65 }
66 </script> 60 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fullscreen/full-screen-no-style-sharing.html ('k') | LayoutTests/fullscreen/full-screen-remove.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698