Bug 1190083 - Rename mozbrowsermediaplaybackchange to mozbrowseraudioplaybackchange; r=fabrice

This commit is contained in:
Ehsan Akhgari 2015-08-01 11:48:52 -04:00
parent 1f87b6a550
commit 84b4de4b3f
7 changed files with 13 additions and 13 deletions

View File

@ -300,7 +300,7 @@ BrowserElementChild.prototype = {
break;
case 'media-playback':
if (subject === content) {
sendAsyncMsg('mediaplaybackchange', { _payload_: data });
sendAsyncMsg('audioplaybackchange', { _payload_: data });
}
break;
case 'xpcom-shutdown':

View File

@ -205,7 +205,7 @@ BrowserElementParent.prototype = {
};
let mmSecuritySensitiveCalls = {
"mediaplaybackchange": this._fireEventFromMsg,
"audioplaybackchange": this._fireEventFromMsg,
"showmodalprompt": this._handleShowModalPrompt,
"contextmenu": this._fireCtxMenuEvent,
"securitychange": this._fireEventFromMsg,

View File

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the public domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test the mozbrowsermediaplaybackchange event is fired correctly.
// Test the mozbrowseraudioplaybackchange event is fired correctly.
'use strict';
const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm');
@ -13,7 +13,7 @@ browserElementTestHelpers.addPermission();
/**
* Content script passed to the child iframe
*/
function playMediaScript() {
function playAudioScript() {
var audio = new content.Audio();
content.document.body.appendChild(audio);
audio.oncanplay = function() {
@ -42,14 +42,14 @@ function runTest() {
// an audio element and play it.
iframe.addEventListener('mozbrowserloadend', () => {
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
mm.loadFrameScript('data:,(' + playMediaScript.toString() + ')();', false);
mm.loadFrameScript('data:,(' + playAudioScript.toString() + ')();', false);
});
// Two events should come in, when the audio starts, and stops playing.
// The first one should have a detail of 'active' and the second one
// should have a detail of 'inactive'.
let expectedNextData = 'active';
iframe.addEventListener('mozbrowsermediaplaybackchange', (e) => {
iframe.addEventListener('mozbrowseraudioplaybackchange', (e) => {
is(e.detail, expectedNextData, 'Audio detail should be correct')
is(e.target, iframe, 'event target should be the first iframe')
if (e.detail === 'inactive') {
@ -59,9 +59,9 @@ function runTest() {
});
// Make sure an event only goes to the first iframe.
iframe2.addEventListener('mozbrowsermediaplaybackchange', (e) => {
iframe2.addEventListener('mozbrowseraudioplaybackchange', (e) => {
ok(false,
'mozbrowsermediaplaybackchange should dispatch to the correct browser');
'mozbrowseraudioplaybackchange should dispatch to the correct browser');
});
// Load a simple page to get the process started.

View File

@ -56,7 +56,7 @@ skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_LoadEvents.html]
[test_browserElement_oop_Manifestchange.html]
[test_browserElement_oop_Metachange.html]
[test_browserElement_oop_MediaPlayback.html]
[test_browserElement_oop_AudioPlayback.html]
[test_browserElement_oop_OpenMixedProcess.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_OpenNamed.html]

View File

@ -40,7 +40,7 @@ support-files =
browserElement_LoadEvents.js
browserElement_Manifestchange.js
browserElement_Metachange.js
browserElement_MediaPlayback.js
browserElement_AudioPlayback.js
browserElement_NextPaint.js
browserElement_OpenNamed.js
browserElement_OpenTab.js
@ -144,6 +144,7 @@ skip-if = buildapp == 'b2g'
skip-if = toolkit == 'android' || buildapp == 'b2g'
[test_browserElement_inproc_AppWindowNamespace.html]
skip-if = toolkit == 'android' || buildapp == 'b2g' # android(TIMED_OUT, bug 783509) androidx86(TIMED_OUT, bug 783509)
[test_browserElement_inproc_AudioPlayback.html]
[test_browserElement_inproc_Auth.html]
skip-if = buildapp == 'b2g'
[test_browserElement_inproc_BackForward.html]
@ -180,7 +181,6 @@ skip-if = (toolkit == 'android' && processor == 'x86') #x86 only
[test_browserElement_inproc_LoadEvents.html]
[test_browserElement_inproc_Manifestchange.html]
[test_browserElement_inproc_Metachange.html]
[test_browserElement_inproc_MediaPlayback.html]
[test_browserElement_inproc_NextPaint.html]
[test_browserElement_inproc_OpenNamed.html]
skip-if = (toolkit == 'gonk' && !debug)

View File

@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1180824
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1180824">Mozilla Bug 1180824</a>
<script type="application/javascript;version=1.7" src="browserElement_MediaPlayback.js">
<script type="application/javascript;version=1.7" src="browserElement_AudioPlayback.js">
</script>
</body>
</html>

View File

@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1180824
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1180824">Mozilla Bug 1180824</a>
<script type="application/javascript;version=1.7" src="browserElement_MediaPlayback.js">
<script type="application/javascript;version=1.7" src="browserElement_AudioPlayback.js">
</script>
</body>
</html>