file_fullscreen-multiple.html (1558B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=724554 5 6 Test that multiple windows can be fullscreen at the same time. 7 8 Open one window, focus it and enter fullscreen, then open another, focus 9 it and enter fullscreen, and check that both are still fullscreen. 10 11 --> 12 <head> 13 <title>Test for Bug 724554</title> 14 <script src="/tests/SimpleTest/EventUtils.js"></script> 15 <script src="/tests/SimpleTest/SimpleTest.js"></script> 16 <script type="application/javascript" src="file_fullscreen-utils.js"></script> 17 </head> 18 <body> 19 20 <script type="application/javascript"> 21 22 /** Test for Bug 545812 */ 23 24 function ok(condition, msg) { 25 opener.ok(condition, "[multiple] " + msg); 26 } 27 28 function is(a, b, msg) { 29 opener.is(a, b, "[multiple] " + msg); 30 } 31 32 var window1, window2; 33 34 function openWindow(id) { 35 var w = window.open("file_fullscreen-multiple-inner.html", "", "width=500,height=500"); 36 waitForLoadAndPaint(w, function() { 37 SimpleTest.waitForFocus(function() { 38 info(`Window ${id} is focused, starting test...`); 39 w.begin(id); 40 }, w); 41 w.focus(); 42 }); 43 return w; 44 } 45 46 function begin() { 47 window1 = openWindow("one"); 48 } 49 50 function enteredFullscreen(id) { 51 if (id == "one") { 52 window2 = openWindow("two"); 53 } else if (id == "two") { 54 ok(window1.document.fullscreenElement && 55 window2.document.fullscreenElement, 56 "Both windows should be fullscreen concurrently"); 57 window1.close(); 58 window2.close(); 59 opener.nextTest(); 60 } 61 } 62 63 </script> 64 </pre> 65 <div id="full-screen-element"></div> 66 </body> 67 </html>