Bug 947854 part 3 - Include testing MozExitedFullscreen event in existing chrome test. r=smaug

--HG--
rename : dom/tests/mochitest/chrome/MozEnteredDomFullscreen_chrome.xul => dom/tests/mochitest/chrome/MozDomFullscreen_chrome.xul
rename : dom/tests/mochitest/chrome/test_MozEnteredDomFullscreen_event.xul => dom/tests/mochitest/chrome/test_MozDomFullscreen_event.xul
rename : dom/tests/mochitest/general/file_MozEnteredDomFullscreen.html => dom/tests/mochitest/general/file_MozDomFullscreen.html
extra : source : 5c96373bda1510a2b4b4282ac50586885ab3c486
This commit is contained in:
Xidorn Quan 2015-05-06 10:04:31 +12:00
Родитель 2ae6dcc764
Коммит 6ba169f015
5 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -60,7 +60,18 @@ function thirdEntry(event) {
is(event.target, gOuterDoc, "Third MozEnteredDomFullscreen should be targeted at outer doc");
ok(gOuterDoc.mozFullScreenElement != null, "Outer doc return to fullscreen after cancel fullscreen in inner doc");
window.removeEventListener("MozEnteredDomFullscreen", thirdEntry, false);
window.removeEventListener("MozExitedDomFullscreen", earlyExit, false);
window.addEventListener("MozExitedDomFullscreen", lastExit, false);
gOuterDoc.mozCancelFullScreen();
}
function earlyExit(event) {
ok(false, "MozExitedDomFullscreen should only be triggered after cancel all fullscreen");
}
function lastExit(event) {
is(event.target, gOuterDoc, "MozExitedDomFullscreen should be targeted at the last exited doc");
ok(gOuterDoc.mozFullScreenElement == null, "Fullscreen should have been fully exited");
window.opener.wrappedJSObject.done();
}
@ -71,6 +82,7 @@ function start() {
gOuterDoc = gBrowser.contentDocument;
gBrowser.contentWindow.focus();
window.addEventListener("MozEnteredDomFullscreen", firstEntry, false);
window.addEventListener("MozExitedDomFullscreen", earlyExit, false);
gOuterDoc.body.mozRequestFullScreen();
});
}
@ -78,6 +90,6 @@ function start() {
]]>
</script>
<!-- chrome://mochitests/content/chrome/dom/tests/mochitest/chrome/test_MozEnteredDomFullscreen_event.xul -->
<browser type="content" id="browser" width="400" height="400" src="http://mochi.test:8888/tests/dom/tests/mochitest/general/file_MozEnteredDomFullscreen.html"/>
<browser type="content" id="browser" width="400" height="400" src="http://mochi.test:8888/tests/dom/tests/mochitest/general/file_MozDomFullscreen.html"/>
</window>

Просмотреть файл

@ -4,7 +4,7 @@ support-files =
489127.html
DOMWindowCreated_chrome.xul
DOMWindowCreated_content.html
MozEnteredDomFullscreen_chrome.xul
MozDomFullscreen_chrome.xul
child_focus_frame.html
file_DOM_element_instanceof.xul
file_bug799299.xul
@ -49,7 +49,7 @@ skip-if = os == 'linux'
[test_indexedSetter.html]
[test_moving_nodeList.xul]
[test_moving_xhr.xul]
[test_MozEnteredDomFullscreen_event.xul]
[test_MozDomFullscreen_event.xul]
# disabled on OS X for intermittent failures--bug-798848
skip-if = toolkit == 'cocoa'
[test_nodesFromRect.html]

Просмотреть файл

@ -36,7 +36,7 @@ SpecialPowers.pushPrefEnv({"set": [['full-screen-api.enabled', true],
['full-screen-api.allow-trusted-requests-only', false]]}, setup);
function setup() {
newwindow = window.open("MozEnteredDomFullscreen_chrome.xul", "_blank","chrome,resizable=yes,width=400,height=400");
newwindow = window.open("MozDomFullscreen_chrome.xul", "_blank","chrome,resizable=yes,width=400,height=400");
}
function done()

Просмотреть файл

@ -1,7 +1,7 @@
[DEFAULT]
support-files =
497633.html
file_MozEnteredDomFullscreen.html
file_MozDomFullscreen.html
file_bug628069.html
file_clonewrapper.html
file_domWindowUtils_scrollbarSize.html