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 class MockMediaDecoderOwner : public MediaDecoderOwner { 14 public: DispatchAsyncEvent(const nsAString & aName)15 void DispatchAsyncEvent(const nsAString& aName) override {} FireTimeUpdate(bool aPeriodic)16 void FireTimeUpdate(bool aPeriodic) override {} GetPaused()17 bool GetPaused() override { return false; } MetadataLoaded(const MediaInfo * aInfo,UniquePtr<const MetadataTags> aTags)18 void MetadataLoaded(const MediaInfo* aInfo, 19 UniquePtr<const MetadataTags> aTags) override {} NetworkError()20 void NetworkError() override {} DecodeError(const MediaResult & aError)21 void DecodeError(const MediaResult& aError) override {} HasError()22 bool HasError() const override { return false; } LoadAborted()23 void LoadAborted() override {} PlaybackEnded()24 void PlaybackEnded() override {} SeekStarted()25 void SeekStarted() override {} SeekCompleted()26 void SeekCompleted() override {} DownloadProgressed()27 void DownloadProgressed() override {} UpdateReadyState()28 void UpdateReadyState() override {} FirstFrameLoaded()29 void FirstFrameLoaded() override {} DispatchEncrypted(const nsTArray<uint8_t> & aInitData,const nsAString & aInitDataType)30 void DispatchEncrypted(const nsTArray<uint8_t>& aInitData, 31 const nsAString& aInitDataType) override {} DownloadSuspended()32 void DownloadSuspended() override {} DownloadResumed(bool aForceNetworkLoading)33 void DownloadResumed(bool aForceNetworkLoading) override {} NotifySuspendedByCache(bool aIsSuspended)34 void NotifySuspendedByCache(bool aIsSuspended) override {} NotifyDecoderPrincipalChanged()35 void NotifyDecoderPrincipalChanged() override {} SetAudibleState(bool aAudible)36 void SetAudibleState(bool aAudible) override {} NotifyXPCOMShutdown()37 void NotifyXPCOMShutdown() override {} AbstractMainThread()38 AbstractThread* AbstractMainThread() const override { 39 // Non-DocGroup version for Mock. 40 return AbstractThread::MainThread(); 41 } ConstructMediaTracks(const MediaInfo * aInfo)42 void ConstructMediaTracks(const MediaInfo* aInfo) {} RemoveMediaTracks()43 void RemoveMediaTracks() {} AsyncResolveSeekDOMPromiseIfExists()44 void AsyncResolveSeekDOMPromiseIfExists() override {} AsyncRejectSeekDOMPromiseIfExists()45 void AsyncRejectSeekDOMPromiseIfExists() override {} 46 }; 47 } // namespace mozilla 48 49 #endif 50