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

Unified Diff: media/blink/video_frame_compositor_unittest.cc

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. Created 5 years, 8 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/blink/video_frame_compositor.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/video_frame_compositor_unittest.cc
diff --git a/media/blink/video_frame_compositor_unittest.cc b/media/blink/video_frame_compositor_unittest.cc
index b95a50002ee86ef3e453b0c74d256f92a44b3a22..43d750a26256f3af487ba29e6a102459c953f52c 100644
--- a/media/blink/video_frame_compositor_unittest.cc
+++ b/media/blink/video_frame_compositor_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
#include "cc/layers/video_frame_provider.h"
#include "media/base/video_frame.h"
#include "media/blink/video_frame_compositor.h"
@@ -16,7 +15,6 @@ class VideoFrameCompositorTest : public testing::Test,
public:
VideoFrameCompositorTest()
: compositor_(new VideoFrameCompositor(
- message_loop.task_runner(),
base::Bind(&VideoFrameCompositorTest::NaturalSizeChanged,
base::Unretained(this)),
base::Bind(&VideoFrameCompositorTest::OpacityChanged,
@@ -43,8 +41,6 @@ class VideoFrameCompositorTest : public testing::Test,
private:
// cc::VideoFrameProvider::Client implementation.
void StopUsingProvider() override {}
- void StartRendering() override {};
- void StopRendering() override {};
void DidReceiveFrame() override {
++did_receive_frame_count_;
}
@@ -60,7 +56,6 @@ class VideoFrameCompositorTest : public testing::Test,
opaque_ = opaque;
}
- base::MessageLoop message_loop;
scoped_ptr<VideoFrameCompositor> compositor_;
int did_receive_frame_count_;
int natural_size_changed_count_;
@@ -75,12 +70,12 @@ TEST_F(VideoFrameCompositorTest, InitialValues) {
EXPECT_FALSE(compositor()->GetCurrentFrame().get());
}
-TEST_F(VideoFrameCompositorTest, PaintFrameUsingOldRenderingPath) {
+TEST_F(VideoFrameCompositorTest, UpdateCurrentFrame) {
scoped_refptr<VideoFrame> expected = VideoFrame::CreateEOSFrame();
// Should notify compositor synchronously.
EXPECT_EQ(0, did_receive_frame_count());
- compositor()->PaintFrameUsingOldRenderingPath(expected);
+ compositor()->UpdateCurrentFrame(expected);
scoped_refptr<VideoFrame> actual = compositor()->GetCurrentFrame();
EXPECT_EQ(expected, actual);
EXPECT_EQ(1, did_receive_frame_count());
@@ -101,29 +96,29 @@ TEST_F(VideoFrameCompositorTest, NaturalSizeChanged) {
EXPECT_EQ(0, natural_size_changed_count());
// Callback isn't fired for the first frame.
- compositor()->PaintFrameUsingOldRenderingPath(initial_frame);
+ compositor()->UpdateCurrentFrame(initial_frame);
EXPECT_EQ(0, natural_size().width());
EXPECT_EQ(0, natural_size().height());
EXPECT_EQ(0, natural_size_changed_count());
// Callback should be fired once.
- compositor()->PaintFrameUsingOldRenderingPath(larger_frame);
+ compositor()->UpdateCurrentFrame(larger_frame);
EXPECT_EQ(larger_size.width(), natural_size().width());
EXPECT_EQ(larger_size.height(), natural_size().height());
EXPECT_EQ(1, natural_size_changed_count());
- compositor()->PaintFrameUsingOldRenderingPath(larger_frame);
+ compositor()->UpdateCurrentFrame(larger_frame);
EXPECT_EQ(larger_size.width(), natural_size().width());
EXPECT_EQ(larger_size.height(), natural_size().height());
EXPECT_EQ(1, natural_size_changed_count());
// Callback is fired once more when switching back to initial size.
- compositor()->PaintFrameUsingOldRenderingPath(initial_frame);
+ compositor()->UpdateCurrentFrame(initial_frame);
EXPECT_EQ(initial_size.width(), natural_size().width());
EXPECT_EQ(initial_size.height(), natural_size().height());
EXPECT_EQ(2, natural_size_changed_count());
- compositor()->PaintFrameUsingOldRenderingPath(initial_frame);
+ compositor()->UpdateCurrentFrame(initial_frame);
EXPECT_EQ(initial_size.width(), natural_size().width());
EXPECT_EQ(initial_size, natural_size());
EXPECT_EQ(2, natural_size_changed_count());
@@ -142,22 +137,22 @@ TEST_F(VideoFrameCompositorTest, OpacityChanged) {
EXPECT_EQ(0, opacity_changed_count());
// Callback is fired for the first frame.
- compositor()->PaintFrameUsingOldRenderingPath(not_opaque_frame);
+ compositor()->UpdateCurrentFrame(not_opaque_frame);
EXPECT_FALSE(opaque());
EXPECT_EQ(1, opacity_changed_count());
// Callback shouldn't be first subsequent times with same opaqueness.
- compositor()->PaintFrameUsingOldRenderingPath(not_opaque_frame);
+ compositor()->UpdateCurrentFrame(not_opaque_frame);
EXPECT_FALSE(opaque());
EXPECT_EQ(1, opacity_changed_count());
// Callback is fired when using opacity changes.
- compositor()->PaintFrameUsingOldRenderingPath(opaque_frame);
+ compositor()->UpdateCurrentFrame(opaque_frame);
EXPECT_TRUE(opaque());
EXPECT_EQ(2, opacity_changed_count());
// Callback shouldn't be first subsequent times with same opaqueness.
- compositor()->PaintFrameUsingOldRenderingPath(opaque_frame);
+ compositor()->UpdateCurrentFrame(opaque_frame);
EXPECT_TRUE(opaque());
EXPECT_EQ(2, opacity_changed_count());
}
« no previous file with comments | « media/blink/video_frame_compositor.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698