зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5deeb2644977 (bug 1607882) for Browser-chrome failures in pictureinpicture/tests/browser_dblclickFullscreen.js. CLOSED TREE
This commit is contained in:
Родитель
7b8e71bc82
Коммит
3c3c2b665a
|
@ -65,7 +65,6 @@ let Player = {
|
|||
WINDOW_EVENTS: [
|
||||
"click",
|
||||
"contextmenu",
|
||||
"dblclick",
|
||||
"keydown",
|
||||
"mouseout",
|
||||
"resize",
|
||||
|
@ -172,11 +171,6 @@ let Player = {
|
|||
break;
|
||||
}
|
||||
|
||||
case "dblclick": {
|
||||
this.onDblClick(event);
|
||||
break;
|
||||
}
|
||||
|
||||
case "keydown": {
|
||||
if (event.keyCode == KeyEvent.DOM_VK_TAB) {
|
||||
this.controls.setAttribute("keying", true);
|
||||
|
@ -185,10 +179,6 @@ let Player = {
|
|||
this.controls.hasAttribute("keying")
|
||||
) {
|
||||
this.controls.removeAttribute("keying");
|
||||
|
||||
// We preventDefault to avoid exiting fullscreen if we happen
|
||||
// to be in it.
|
||||
event.preventDefault();
|
||||
} else if (
|
||||
Services.prefs.getBoolPref(KEYBOARD_CONTROLS_ENABLED_PREF, false) &&
|
||||
!this.controls.hasAttribute("keying") &&
|
||||
|
@ -225,17 +215,6 @@ let Player = {
|
|||
}
|
||||
},
|
||||
|
||||
onDblClick(event) {
|
||||
if (event.target.id == "controls") {
|
||||
if (document.fullscreenElement == document.body) {
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
document.body.requestFullscreen();
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
onClick(event) {
|
||||
switch (event.target.id) {
|
||||
case "audio": {
|
||||
|
|
|
@ -23,7 +23,6 @@ prefs =
|
|||
[browser_contextMenu.js]
|
||||
[browser_closePlayer.js]
|
||||
[browser_closeTab.js]
|
||||
[browser_dblclickFullscreen.js]
|
||||
[browser_disabledForMediaStreamVideos.js]
|
||||
[browser_fullscreen.js]
|
||||
skip-if = (os == "mac" && debug) #Bug 1566173
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Tests that double-clicking on the Picture-in-Picture player window
|
||||
* causes it to fullscreen, and that pressing Escape allows us to exit
|
||||
* fullscreen.
|
||||
*/
|
||||
add_task(async () => {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
gBrowser,
|
||||
url: TEST_PAGE,
|
||||
},
|
||||
async browser => {
|
||||
let pipWin = await triggerPictureInPicture(browser, "no-controls");
|
||||
|
||||
let entered = BrowserTestUtils.waitForEvent(
|
||||
pipWin,
|
||||
"MozDOMFullscreen:Entered"
|
||||
);
|
||||
|
||||
let controls = pipWin.document.getElementById("controls");
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{
|
||||
type: "dblclick",
|
||||
},
|
||||
controls,
|
||||
pipWin
|
||||
);
|
||||
|
||||
await entered;
|
||||
|
||||
Assert.equal(
|
||||
pipWin.document.fullscreenElement,
|
||||
pipWin.document.body,
|
||||
"Double-click caused us to enter fullscreen."
|
||||
);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !TelemetryStopwatch.running("FULLSCREEN_CHANGE_MS");
|
||||
});
|
||||
|
||||
// First, we'll test exiting fullscreen by double-clicking again
|
||||
// on the document body.
|
||||
|
||||
let exited = BrowserTestUtils.waitForEvent(
|
||||
pipWin,
|
||||
"MozDOMFullscreen:Exited"
|
||||
);
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{
|
||||
type: "dblclick",
|
||||
},
|
||||
controls,
|
||||
pipWin
|
||||
);
|
||||
|
||||
await exited;
|
||||
|
||||
Assert.ok(
|
||||
!pipWin.document.fullscreenElement,
|
||||
"Double-click caused us to exit fullscreen."
|
||||
);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !TelemetryStopwatch.running("FULLSCREEN_CHANGE_MS");
|
||||
});
|
||||
|
||||
// Now we double-click to re-enter fullscreen.
|
||||
|
||||
entered = BrowserTestUtils.waitForEvent(
|
||||
pipWin,
|
||||
"MozDOMFullscreen:Entered"
|
||||
);
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{
|
||||
type: "dblclick",
|
||||
},
|
||||
controls,
|
||||
pipWin
|
||||
);
|
||||
|
||||
await entered;
|
||||
|
||||
Assert.equal(
|
||||
pipWin.document.fullscreenElement,
|
||||
pipWin.document.body,
|
||||
"Double-click caused us to re-enter fullscreen."
|
||||
);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !TelemetryStopwatch.running("FULLSCREEN_CHANGE_MS");
|
||||
});
|
||||
|
||||
// Finally, we check that hitting Escape lets the user leave
|
||||
// fullscreen.
|
||||
|
||||
exited = BrowserTestUtils.waitForEvent(pipWin, "MozDOMFullscreen:Exited");
|
||||
|
||||
EventUtils.synthesizeKey("KEY_Escape", {}, pipWin);
|
||||
|
||||
await exited;
|
||||
|
||||
Assert.ok(
|
||||
!pipWin.document.fullscreenElement,
|
||||
"Pressing Escape caused us to exit fullscreen."
|
||||
);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !TelemetryStopwatch.running("FULLSCREEN_CHANGE_MS");
|
||||
});
|
||||
|
||||
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
|
||||
pipWin.close();
|
||||
await pipClosed;
|
||||
}
|
||||
);
|
||||
});
|
Загрузка…
Ссылка в новой задаче