diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 23:51:41 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 23:51:41 +0000 |
commit | b69246a07efee76c920f4f3bea809efcb9f15e6e (patch) | |
tree | 8bfedae139f4029354e2d39babaa411399f78cc7 /media/base/test_helpers.h | |
parent | f4dd3d3c18e6c586d4303643b10d2df108770734 (diff) | |
download | chromium_src-b69246a07efee76c920f4f3bea809efcb9f15e6e.zip chromium_src-b69246a07efee76c920f4f3bea809efcb9f15e6e.tar.gz chromium_src-b69246a07efee76c920f4f3bea809efcb9f15e6e.tar.bz2 |
Introduce TestVideoConfig class.
We have a lot of cases where we need some pre-canned VideoDecoderConfig for
testing purposes. In these tests, we only care about general categories of the
video configs (e.g. validity, config change and encryption) rather than details
like visible rect and extra data. The new TestVideoConfig class serves
this purpose.
TEST=Unittests still pass.
Review URL: https://chromiumcodereview.appspot.com/14238019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/test_helpers.h')
-rw-r--r-- | media/base/test_helpers.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/media/base/test_helpers.h b/media/base/test_helpers.h index 097c5f8..bc505d4 100644 --- a/media/base/test_helpers.h +++ b/media/base/test_helpers.h @@ -5,9 +5,12 @@ #ifndef MEDIA_BASE_TEST_HELPERS_H_ #define MEDIA_BASE_TEST_HELPERS_H_ +#include "base/basictypes.h" #include "base/callback.h" #include "media/base/pipeline_status.h" +#include "media/base/video_decoder_config.h" #include "testing/gmock/include/gmock/gmock.h" +#include "ui/gfx/size.h" namespace base { class MessageLoop; @@ -54,6 +57,28 @@ class WaitableMessageLoopEvent { DISALLOW_COPY_AND_ASSIGN(WaitableMessageLoopEvent); }; +// Provides pre-canned VideoDecoderConfig. These types are used for tests that +// don't care about detailed parameters of the config. +class TestVideoConfig { + public: + // Returns a configuration that is invalid. + static VideoDecoderConfig Invalid(); + + static VideoDecoderConfig Normal(); + static VideoDecoderConfig NormalEncrypted(); + + // Returns a configuration that is larger in dimensions than Normal(). + static VideoDecoderConfig Large(); + static VideoDecoderConfig LargeEncrypted(); + + // Returns coded size for Normal and Large config. + static gfx::Size NormalCodedSize(); + static gfx::Size LargeCodedSize(); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(TestVideoConfig); +}; + } // namespace media #endif // MEDIA_BASE_TEST_HELPERS_H_ |