Bug 690989 - Ensure we're focused before requesting fullscreen in rollback test. r=smaug a=test-only
authorChris Pearce <cpearce@mozilla.com>
Mon, 23 Apr 2012 22:48:00 +1200
changeset 95439 137acae37ff9ac940aa45dbf0955bdfb13bfd223
parent 95438 3af815def68275b347f78241057d3c6649c4e029
child 95440 697b229db32aa8e17beac6303908e690ddd9743b
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs690989
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 690989 - Ensure we're focused before requesting fullscreen in rollback test. r=smaug a=test-only
content/html/content/test/file_fullscreen-rollback.html
--- a/content/html/content/test/file_fullscreen-rollback.html
+++ b/content/html/content/test/file_fullscreen-rollback.html
@@ -49,36 +49,41 @@ function addListener(type, f) {
 function removeListener(type, f) {
   document.removeEventListener("mozfullscreen" + type, f, false);
 }
 
 function e(id) {
   return document.getElementById(id);
 }
 
+function requestFullscreen(element) {
+  element.focus();
+  element.mozRequestFullScreen();
+}
+
 function begin() {
   addListener("change", change1);
   e("fse").mozRequestFullScreen();
 }
 
 function change1() {
   removeListener("change", change1);
   addListener("error", error1);
   is(document.mozFullScreenElement, e("fse"), "Body should be FSE");
   
   // Request full-screen from element not descendent from current FSE.
-  e("non-fse").mozRequestFullScreen();
+  requestFullscreen(e("non-fse"));
 }
 
 function error1() {
   removeListener("error", error1);
   addListener("change", change2);
   is(document.mozFullScreenElement, e("fse"), "FSE should not change");
   var iframe = e("subdoc");
-  iframe.contentDocument.body.mozRequestFullScreen();
+  requestFullscreen(iframe.contentDocument.body);
 }
 
 function change2() {
   removeListener("change", change2);
   var iframe = e("subdoc");
   is(document.mozFullScreenElement, iframe, "Subdoc container should be FSE.");
   is(iframe.contentDocument.mozFullScreenElement, iframe.contentDocument.body, "Subdoc body should be FSE in subdoc");
   addListener("change", change3);
@@ -91,24 +96,24 @@ function change3() {
   addListener("change", change4);
   document.mozCancelFullScreen();
 }
 
 function change4() {
   removeListener("change", change4);
   is(document.mozFullScreenElement, null, "Should have left full-screen entirely");
   addListener("change", change5);
-  e("fse").mozRequestFullScreen();
+  requestFullscreen(e("fse"));
 }
 
 function change5() {
   removeListener("change", change5);
   addListener("change", change6);
   is(document.mozFullScreenElement, e("fse"), "FSE should be e('fse')");
-  e("fse-inner").mozRequestFullScreen();
+  requestFullscreen(e("fse-inner"));
 }
 
 function change6() {
   removeListener("change", change6);
   addListener("change", change7);
   var element = e('fse-inner');
   is(document.mozFullScreenElement, element, "FSE should be e('fse-inner')");
   element.parentNode.removeChild(element);