Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: media/filters/test_video_renderer.h

Issue 149423: Converted remaining tests to use gmock and deleted all old mocking code. (Closed)
Patch Set: Fix again Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/test_video_decoder.h ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/test_video_renderer.h
diff --git a/media/filters/test_video_renderer.h b/media/filters/test_video_renderer.h
deleted file mode 100644
index f9535f2636844faddf95c58751ff02d8d10941e9..0000000000000000000000000000000000000000
--- a/media/filters/test_video_renderer.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
-//
-// Simple test class used by unit tests. Tests create the filter on the test's
-// thread and then use InstanceFilterFactory to force the test's instance to
-// be returned to the pipeline.
-
-#ifndef MEDIA_FILTERS_TEST_VIDEO_RENDERER_H_
-#define MEDIA_FILTERS_TEST_VIDEO_RENDERER_H_
-
-#include "media/base/buffers.h"
-#include "media/base/factory.h"
-#include "media/base/filters.h"
-#include "media/filters/video_renderer_base.h"
-
-namespace media {
-
-class TestVideoRenderer : public VideoRendererBase {
- public:
- TestVideoRenderer()
- : last_frame_(NULL),
- paint_called_(0),
- unique_frames_(0) {
- }
-
- virtual bool OnInitialize(size_t width, size_t height) { return true; }
-
- virtual void OnPaintNeeded() {
- ++paint_called_;
- scoped_refptr<VideoFrame> frame;
- GetCurrentFrame(&frame);
- if (frame.get()) {
- VideoSurface video_surface;
- EXPECT_TRUE(frame->Lock(&video_surface));
- frame->Unlock();
- if (frame != last_frame_) {
- ++unique_frames_;
- last_frame_ = frame;
- last_timestamp_ = frame->GetTimestamp();
- }
- }
- }
-
- size_t unique_frames() { return unique_frames_; }
- size_t paint_called() { return paint_called_; }
- base::TimeDelta last_timestamp() { return last_timestamp_; }
-
- static bool IsMediaFormatSupported(const MediaFormat& format) {
- return VideoRendererBase::IsMediaFormatSupported(format);
- }
-
- private:
- friend class scoped_refptr<TestVideoRenderer>;
- virtual ~TestVideoRenderer() {}
-
- VideoFrame* last_frame_;
- size_t paint_called_;
- size_t unique_frames_;
- base::TimeDelta last_timestamp_;
-
- DISALLOW_COPY_AND_ASSIGN(TestVideoRenderer);
-};
-
-} // namespace
-
-#endif // MEDIA_FILTERS_TEST_VIDEO_RENDERER_H_
« no previous file with comments | « media/filters/test_video_decoder.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698