From 156539e7156b35140764af41b80cfc7f89584ffe Mon Sep 17 00:00:00 2001 From: Diogo Golovanevsky Monteiro Date: Tue, 15 May 2012 09:00:54 -0400 Subject: [PATCH] Bug 728893 - Allow mochitest iframe to go fullscreen. r=ctalbert --- testing/mochitest/harness-overlay.xul | 2 +- testing/mochitest/plain-loop.html | 2 +- testing/mochitest/server.js | 2 +- testing/mochitest/tests/Makefile.in | 1 + .../mochitest/tests/SimpleTest/SimpleTest.js | 4 ++ .../tests/test_cancelFullScreen.html | 51 +++++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 testing/mochitest/tests/test_cancelFullScreen.html diff --git a/testing/mochitest/harness-overlay.xul b/testing/mochitest/harness-overlay.xul index d2c7e20ec21..33420b8e0d9 100644 --- a/testing/mochitest/harness-overlay.xul +++ b/testing/mochitest/harness-overlay.xul @@ -82,7 +82,7 @@ function loadTests()
- +
diff --git a/testing/mochitest/plain-loop.html b/testing/mochitest/plain-loop.html index 787cb75d42f..6ea6ee0e133 100644 --- a/testing/mochitest/plain-loop.html +++ b/testing/mochitest/plain-loop.html @@ -43,7 +43,7 @@ function loadTests()
- +
diff --git a/testing/mochitest/server.js b/testing/mochitest/server.js index 3385b7313f1..8e8e1e8c267 100644 --- a/testing/mochitest/server.js +++ b/testing/mochitest/server.js @@ -653,7 +653,7 @@ function testListing(metadata, response) ), DIV({class: "clear"}), DIV({class: "frameholder"}, - IFRAME({scrolling: "no", id: "testframe", width: "500", height: "300"}) + IFRAME({scrolling: "no", id: "testframe", width: "500", height: "300", mozallowfullscreen: "true"}) ), DIV({class: "clear"}), DIV({class: "toggle"}, diff --git a/testing/mochitest/tests/Makefile.in b/testing/mochitest/tests/Makefile.in index 2e110a83e9b..232f9e5cec3 100644 --- a/testing/mochitest/tests/Makefile.in +++ b/testing/mochitest/tests/Makefile.in @@ -60,6 +60,7 @@ _TEST_FILES = \ test_SpecialPowersExtension.html \ test_SpecialPowersExtension2.html \ file_SpecialPowersFrame1.html \ + test_cancelFullScreen.html \ $(NULL) ifneq ($(OS_TARGET),Android) diff --git a/testing/mochitest/tests/SimpleTest/SimpleTest.js b/testing/mochitest/tests/SimpleTest/SimpleTest.js index 1ac9509b981..776093e0142 100644 --- a/testing/mochitest/tests/SimpleTest/SimpleTest.js +++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js @@ -680,6 +680,10 @@ SimpleTest.executeSoon = function(aFunc) { * SimpleTest.waitForExplicitFinish() has been invoked. **/ SimpleTest.finish = function () { + // Cancel element fullscreen mode due to Bug 728893 + if (document && document.mozFullScreenElement) { + document.mozCancelFullScreen(); + } if (SimpleTest._expectingUncaughtException) { SimpleTest.ok(false, "expectUncaughtException was called but no uncaught exception was detected!"); } diff --git a/testing/mochitest/tests/test_cancelFullScreen.html b/testing/mochitest/tests/test_cancelFullScreen.html new file mode 100644 index 00000000000..9e1391a2112 --- /dev/null +++ b/testing/mochitest/tests/test_cancelFullScreen.html @@ -0,0 +1,51 @@ + + + + Test for Bug 728893 + + + + + + + Mozilla Bug + +
+
+
+
+
+ + \ No newline at end of file