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

Unified Diff: components/exo/buffer_unittest.cc

Issue 2868473002: Implement aura::Window::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues Created 3 years, 7 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
Index: components/exo/buffer_unittest.cc
diff --git a/components/exo/buffer_unittest.cc b/components/exo/buffer_unittest.cc
index 4f34c960011cd90416dae51ef7745517ec24c8af..9fa73791f3e23432b8f5dadfd49421c652abf72f 100644
--- a/components/exo/buffer_unittest.cc
+++ b/components/exo/buffer_unittest.cc
@@ -33,11 +33,8 @@ TEST_F(BufferTest, ReleaseCallback) {
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
std::unique_ptr<Surface> surface(new Surface);
const cc::FrameSinkId arbitrary_frame_sink_id(1, 1);
- scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder =
- new CompositorFrameSinkHolder(surface.get(), arbitrary_frame_sink_id,
- aura::Env::GetInstance()
- ->context_factory_private()
- ->GetSurfaceManager());
+ CompositorFrameSinkHolder* compositor_frame_sink_holder =
+ surface->compositor_frame_sink_holder();
// Set the release callback.
int release_call_count = 0;
@@ -47,8 +44,8 @@ TEST_F(BufferTest, ReleaseCallback) {
buffer->OnAttach();
cc::TransferableResource resource;
// Produce a transferable resource for the contents of the buffer.
- bool rv = buffer->ProduceTransferableResource(
- compositor_frame_sink_holder.get(), 0, false, true, &resource);
+ bool rv = buffer->ProduceTransferableResource(compositor_frame_sink_holder, 0,
+ false, true, &resource);
ASSERT_TRUE(rv);
// Release buffer.
@@ -74,18 +71,15 @@ TEST_F(BufferTest, IsLost) {
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
const cc::FrameSinkId arbitrary_frame_sink_id(1, 1);
std::unique_ptr<Surface> surface(new Surface);
- scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder =
- new CompositorFrameSinkHolder(surface.get(), arbitrary_frame_sink_id,
- aura::Env::GetInstance()
- ->context_factory_private()
- ->GetSurfaceManager());
+ CompositorFrameSinkHolder* compositor_frame_sink_holder =
+ surface->compositor_frame_sink_holder();
cc::ResourceId resource_id = 0;
buffer->OnAttach();
// Acquire a texture transferable resource for the contents of the buffer.
cc::TransferableResource resource;
bool rv = buffer->ProduceTransferableResource(
- compositor_frame_sink_holder.get(), resource_id, false, true, &resource);
+ compositor_frame_sink_holder, resource_id, false, true, &resource);
ASSERT_TRUE(rv);
scoped_refptr<cc::ContextProvider> context_provider =
@@ -112,9 +106,8 @@ TEST_F(BufferTest, IsLost) {
// buffer.
++resource_id;
cc::TransferableResource new_resource;
- rv = buffer->ProduceTransferableResource(compositor_frame_sink_holder.get(),
- resource_id, false, false,
- &new_resource);
+ rv = buffer->ProduceTransferableResource(
+ compositor_frame_sink_holder, resource_id, false, false, &new_resource);
ASSERT_TRUE(rv);
buffer->OnDetach();

Powered by Google App Engine
This is Rietveld 408576698