1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef MOCK_MEDIA_DECODER_OWNER_H_ 6 #define MOCK_MEDIA_DECODER_OWNER_H_ 7 8 #include "MediaDecoderOwner.h" 9 #include "mozilla/AbstractThread.h" 10 11 namespace mozilla 12 { 13 14 class MockMediaDecoderOwner : public MediaDecoderOwner 15 { 16 public: DispatchAsyncEvent(const nsAString & aName)17 void DispatchAsyncEvent(const nsAString& aName) override {} FireTimeUpdate(bool aPeriodic)18 void FireTimeUpdate(bool aPeriodic) override {} GetPaused()19 bool GetPaused() override { return false; } MetadataLoaded(const MediaInfo * aInfo,UniquePtr<const MetadataTags> aTags)20 void MetadataLoaded(const MediaInfo* aInfo, 21 UniquePtr<const MetadataTags> aTags) override 22 { 23 } NetworkError()24 void NetworkError() override {} DecodeError(const MediaResult & aError)25 void DecodeError(const MediaResult& aError) override {} HasError()26 bool HasError() const override { return false; } LoadAborted()27 void LoadAborted() override {} PlaybackEnded()28 void PlaybackEnded() override {} SeekStarted()29 void SeekStarted() override {} SeekCompleted()30 void SeekCompleted() override {} DownloadProgressed()31 void DownloadProgressed() override {} UpdateReadyState()32 void UpdateReadyState() override {} FirstFrameLoaded()33 void FirstFrameLoaded() override {} DispatchEncrypted(const nsTArray<uint8_t> & aInitData,const nsAString & aInitDataType)34 void DispatchEncrypted(const nsTArray<uint8_t>& aInitData, 35 const nsAString& aInitDataType) override {} DownloadSuspended()36 void DownloadSuspended() override {} DownloadResumed(bool aForceNetworkLoading)37 void DownloadResumed(bool aForceNetworkLoading) override {} NotifySuspendedByCache(bool aIsSuspended)38 void NotifySuspendedByCache(bool aIsSuspended) override {} NotifyDecoderPrincipalChanged()39 void NotifyDecoderPrincipalChanged() override {} SetAudibleState(bool aAudible)40 void SetAudibleState(bool aAudible) override {} NotifyXPCOMShutdown()41 void NotifyXPCOMShutdown() override {} AbstractMainThread()42 AbstractThread* AbstractMainThread() const override 43 { 44 // Non-DocGroup version for Mock. 45 return AbstractThread::MainThread(); 46 } ConstructMediaTracks(const MediaInfo * aInfo)47 void ConstructMediaTracks(const MediaInfo* aInfo) {} RemoveMediaTracks()48 void RemoveMediaTracks() {} AsyncResolveSeekDOMPromiseIfExists()49 void AsyncResolveSeekDOMPromiseIfExists() override {} AsyncRejectSeekDOMPromiseIfExists()50 void AsyncRejectSeekDOMPromiseIfExists() override {} 51 }; 52 } 53 54 #endif 55