зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1513681 - part5 : remove event 'AudibleAutoplayMediaOccurred'. r=jaws
This event is used for shield-study which has finished, so we could remove it. Differential Revision: https://phabricator.services.mozilla.com/D14810 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
048a1e2282
Коммит
c64bb9ac90
|
@ -4763,16 +4763,6 @@ window._gBrowser = {
|
|||
}
|
||||
});
|
||||
|
||||
this.addEventListener("AudibleAutoplayMediaOccurred", (event) => {
|
||||
let browser = event.originalTarget;
|
||||
let tab = this.getTabForBrowser(browser);
|
||||
if (!tab) {
|
||||
return;
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(tab, "AudibleAutoplayMediaOccurred");
|
||||
});
|
||||
|
||||
this.addEventListener("GloballyAutoplayBlocked", (event) => {
|
||||
let browser = event.originalTarget;
|
||||
let tab = this.getTabForBrowser(browser);
|
||||
|
|
|
@ -11758,12 +11758,6 @@ void Document::SetDocTreeHadAudibleMedia() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!topLevelDoc->mDocTreeHadAudibleMedia) {
|
||||
RefPtr<AsyncEventDispatcher> asyncDispatcher = new AsyncEventDispatcher(
|
||||
topLevelDoc, NS_LITERAL_STRING("AudibleAutoplayMediaOccurred"),
|
||||
CanBubble::eYes, ChromeOnlyDispatch::eYes);
|
||||
asyncDispatcher->PostDOMEvent();
|
||||
}
|
||||
topLevelDoc->mDocTreeHadAudibleMedia = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,6 @@ ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
|
|||
|
||||
class AutoplayChild extends ActorChild {
|
||||
handleEvent(event) {
|
||||
if (event.type == "AudibleAutoplayMediaOccurred") {
|
||||
this.mm.sendAsyncMessage("AudibleAutoplayMediaOccurred");
|
||||
return;
|
||||
}
|
||||
if (event.type == "GloballyAutoplayBlocked") {
|
||||
this.mm.sendAsyncMessage("GloballyAutoplayBlocked");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ support-files =
|
|||
tags = audiochannel
|
||||
[browser_audioCompeting_onlyForActiveAgent.js]
|
||||
tags = audiochannel
|
||||
[browser_autoplay_audibleMediaOccurred.js]
|
||||
[browser_autoplay_policy_iframe_hierarchy.js]
|
||||
support-files =
|
||||
file_autoplay_three_layers_frame1.html
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* This test is used to test whether the topic 'AudibleAutoplayMediaOccurred'
|
||||
* is sent correctly when the autoplay audible media tries to start.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlayback.html";
|
||||
|
||||
add_task(async function testAudibleAutoplayMedia() {
|
||||
info("- open new tab -");
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(window.gBrowser,
|
||||
"about:blank");
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
// start observing the topic before loading the page to ensure we can get it.
|
||||
let audibleAutoplayOccurred = TestUtils.topicObserved("AudibleAutoplayMediaOccurred");
|
||||
browser.loadURI(PAGE, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await audibleAutoplayOccurred;
|
||||
ok(true, "Got the topic 'AudibleAutoplayMediaOccurred'.");
|
||||
|
||||
info("- remove tab -");
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
|
@ -762,16 +762,6 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<method name="notifyAudibleAutoplayMediaOccurred">
|
||||
<body>
|
||||
<![CDATA[
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("AudibleAutoplayMediaOccurred", true, false);
|
||||
this.dispatchEvent(event);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="notifyGloballyAutoplayBlocked">
|
||||
<body>
|
||||
<![CDATA[
|
||||
|
@ -1121,7 +1111,6 @@
|
|||
this.messageManager.addMessageListener("AudioPlayback:ActiveMediaBlockStart", this);
|
||||
this.messageManager.addMessageListener("AudioPlayback:ActiveMediaBlockStop", this);
|
||||
this.messageManager.addMessageListener("UnselectedTabHover:Toggle", this);
|
||||
this.messageManager.addMessageListener("AudibleAutoplayMediaOccurred", this);
|
||||
this.messageManager.addMessageListener("GloballyAutoplayBlocked", this);
|
||||
|
||||
if (this.hasAttribute("selectmenulist")) {
|
||||
|
@ -1264,9 +1253,6 @@
|
|||
++this._unselectedTabHoverMessageListenerCount > 0 :
|
||||
--this._unselectedTabHoverMessageListenerCount == 0;
|
||||
break;
|
||||
case "AudibleAutoplayMediaOccurred":
|
||||
this.notifyAudibleAutoplayMediaOccurred();
|
||||
break;
|
||||
case "GloballyAutoplayBlocked":
|
||||
this.notifyGloballyAutoplayBlocked();
|
||||
break;
|
||||
|
|
|
@ -118,7 +118,6 @@ let ACTORS = {
|
|||
child: {
|
||||
module: "resource://gre/actors/AutoplayChild.jsm",
|
||||
events: {
|
||||
"AudibleAutoplayMediaOccurred": {},
|
||||
"GloballyAutoplayBlocked": {},
|
||||
},
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче