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

Unified Diff: cc/resources/video_resource_updater_unittest.cc

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 years, 4 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 | « cc/resources/video_resource_updater.cc ('k') | cc/test/fake_context_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater_unittest.cc
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index ca6ebd0d117671ad25749f6a875439982efa09d7..60673edbd91e4935e093e81c89a68a1f2d35ffd3 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -8,6 +8,7 @@
#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/resources/resource_provider.h"
#include "cc/test/fake_output_surface.h"
+#include "cc/test/fake_output_surface_client.h"
#include "media/base/video_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -21,8 +22,9 @@ class VideoResourceUpdaterTest : public testing::Test {
TestWebGraphicsContext3D::Create();
context3d_ = context3d.get();
- output_surface3d_ = FakeOutputSurface::Create3d(
- context3d.PassAs<WebKit::WebGraphicsContext3D>());
+ output_surface3d_ =
+ FakeOutputSurface::Create3d(context3d.Pass());
+ CHECK(output_surface3d_->BindToClient(&client_));
resource_provider3d_ =
ResourceProvider::Create(output_surface3d_.get(), 0);
}
@@ -50,12 +52,14 @@ class VideoResourceUpdaterTest : public testing::Test {
}
TestWebGraphicsContext3D* context3d_;
+ FakeOutputSurfaceClient client_;
scoped_ptr<FakeOutputSurface> output_surface3d_;
scoped_ptr<ResourceProvider> resource_provider3d_;
};
TEST_F(VideoResourceUpdaterTest, SoftwareFrame) {
- VideoResourceUpdater updater(resource_provider3d_.get());
+ VideoResourceUpdater updater(output_surface3d_->context_provider().get(),
+ resource_provider3d_.get());
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
VideoFrameExternalResources resources =
@@ -64,7 +68,8 @@ TEST_F(VideoResourceUpdaterTest, SoftwareFrame) {
}
TEST_F(VideoResourceUpdaterTest, LostContextForSoftwareFrame) {
- VideoResourceUpdater updater(resource_provider3d_.get());
+ VideoResourceUpdater updater(output_surface3d_->context_provider().get(),
+ resource_provider3d_.get());
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
// Fail while creating the mailbox for the second YUV plane.
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/test/fake_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698