Closed Bug 1304250 Opened 8 years ago Closed 8 years ago

[EME] Implement MediaKeySession.onmessage

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: cpearce, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

This Web Platform test is failing because we don't implement MediaKeySession.onmessage: https://w3c-test.org/encrypted-media/idlharness.html Should be an easy fix.
Comment on attachment 8793150 [details] Bug 1304250 - Implement MediaKeySession.onmessage. https://reviewboard.mozilla.org/r/79942/#review78764 comments fixed, r+ ::: dom/media/eme/MediaKeySession.cpp:509 (Diff revision 1) > +MediaKeySession::GetOnmessage() > +{ > + EventListenerManager *elm = GetExistingListenerManager(); > + return elm ? elm->GetEventHandler(nsGkAtoms::onmessage, EmptyString()) > + : nullptr; > +} You could just have return GetEventHandler(nsGkAtoms::onmessage, EmptyString()); ::: dom/media/eme/MediaKeySession.cpp:512 (Diff revision 1) > + return elm ? elm->GetEventHandler(nsGkAtoms::onmessage, EmptyString()) > + : nullptr; > +} > + > +void > +MediaKeySession::SetOnmessage(EventHandlerNonNull* handler) aHandler or aCallback ::: dom/media/eme/MediaKeySession.cpp:518 (Diff revision 1) > +{ > + EventListenerManager *elm = GetOrCreateListenerManager(); > + if (elm) { > + elm->SetEventHandler(nsGkAtoms::onmessage, EmptyString(), handler); > + } > +} You could just have SetEventHandler(nsGkAtoms::onmessage, EmptyString(), aCallback); ::: dom/media/test/test_eme_playback.html:157 (Diff revision 1) > is(session.numKeystatuseschangeEvents, session.numOnkeystatuseschangeEvents, > TimeStamp(token) + " should get as many keystatuseschange as onkeystatuseschange"); > + > + ok(session.numMessageEvents > 0, TimeStamp(token) + " should get message events"); > + is(session.numMessageEvents, session.numOnMessageEvents, > + TimeStamp(token) + " should get as many message as onmessage events"); well, technically the events are 'message' events, never with on-prefix. So "Should have as many event listener calls as event handler calls."
Attachment #8793150 - Flags: review?(bugs) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: