| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "cc/layers/video_frame_provider.h" | 6 #include "cc/layers/video_frame_provider.h" |
| 7 #include "content/renderer/media/video_frame_compositor.h" | |
| 8 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
| 8 #include "media/blink/video_frame_compositor.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace media { |
| 12 | |
| 13 using media::VideoFrame; | |
| 14 | 12 |
| 15 class VideoFrameCompositorTest : public testing::Test, | 13 class VideoFrameCompositorTest : public testing::Test, |
| 16 public cc::VideoFrameProvider::Client { | 14 public cc::VideoFrameProvider::Client { |
| 17 public: | 15 public: |
| 18 VideoFrameCompositorTest() | 16 VideoFrameCompositorTest() |
| 19 : compositor_(new VideoFrameCompositor( | 17 : compositor_(new VideoFrameCompositor( |
| 20 base::Bind(&VideoFrameCompositorTest::NaturalSizeChanged, | 18 base::Bind(&VideoFrameCompositorTest::NaturalSizeChanged, |
| 21 base::Unretained(this)), | 19 base::Unretained(this)), |
| 22 base::Bind(&VideoFrameCompositorTest::OpacityChanged, | 20 base::Bind(&VideoFrameCompositorTest::OpacityChanged, |
| 23 base::Unretained(this)))), | 21 base::Unretained(this)))), |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 compositor()->UpdateCurrentFrame(opaque_frame); | 150 compositor()->UpdateCurrentFrame(opaque_frame); |
| 153 EXPECT_TRUE(opaque()); | 151 EXPECT_TRUE(opaque()); |
| 154 EXPECT_EQ(2, opacity_changed_count()); | 152 EXPECT_EQ(2, opacity_changed_count()); |
| 155 | 153 |
| 156 // Callback shouldn't be first subsequent times with same opaqueness. | 154 // Callback shouldn't be first subsequent times with same opaqueness. |
| 157 compositor()->UpdateCurrentFrame(opaque_frame); | 155 compositor()->UpdateCurrentFrame(opaque_frame); |
| 158 EXPECT_TRUE(opaque()); | 156 EXPECT_TRUE(opaque()); |
| 159 EXPECT_EQ(2, opacity_changed_count()); | 157 EXPECT_EQ(2, opacity_changed_count()); |
| 160 } | 158 } |
| 161 | 159 |
| 162 } // namespace content | 160 } // namespace media |
| OLD | NEW |