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

Unified Diff: cc/surfaces/surface_display_output_surface_unittest.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Display member destruction order Created 4 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 | « cc/surfaces/surface_display_output_surface.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_display_output_surface_unittest.cc
diff --git a/cc/surfaces/surface_display_output_surface_unittest.cc b/cc/surfaces/surface_display_output_surface_unittest.cc
index de06bd31f65ee1fa920b68f3d923e498b6cae628..8315130dfb8440574aad76bd95c2e1ddfccb979e 100644
--- a/cc/surfaces/surface_display_output_surface_unittest.cc
+++ b/cc/surfaces/surface_display_output_surface_unittest.cc
@@ -25,13 +25,15 @@ class FakeOnscreenDisplayClient : public OnscreenDisplayClient {
SharedBitmapManager* bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const RendererSettings& settings,
- scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ uint32_t compositor_surface_namespace)
: OnscreenDisplayClient(FakeOutputSurface::Create3d(),
manager,
bitmap_manager,
gpu_memory_buffer_manager,
settings,
- task_runner) {
+ task_runner,
+ compositor_surface_namespace) {
// Ownership is passed to another object later, store a pointer
// to it now for future reference.
fake_output_surface_ =
@@ -57,7 +59,8 @@ class SurfaceDisplayOutputSurfaceTest : public testing::Test {
&bitmap_manager_,
&gpu_memory_buffer_manager_,
renderer_settings_,
- task_runner_),
+ task_runner_,
+ allocator_.id_namespace()),
context_provider_(TestContextProvider::Create()),
surface_display_output_surface_(&surface_manager_,
&allocator_,
@@ -68,8 +71,16 @@ class SurfaceDisplayOutputSurfaceTest : public testing::Test {
display_client_.set_surface_output_surface(
&surface_display_output_surface_);
surface_display_output_surface_.set_display_client(&display_client_);
+
+ // Set the Display's begin frame source like a real browser compositor
+ // output surface would.
+ begin_frame_source_.reset(
+ new BackToBackBeginFrameSource(task_runner_.get()));
+ display_client_.display()->SetBeginFrameSource(begin_frame_source_.get());
+
surface_display_output_surface_.BindToClient(
&surface_display_output_surface_client_);
+
display_client_.display()->Resize(display_size_);
EXPECT_FALSE(surface_display_output_surface_client_
@@ -104,6 +115,7 @@ class SurfaceDisplayOutputSurfaceTest : public testing::Test {
protected:
std::unique_ptr<base::SimpleTestTickClock> now_src_;
scoped_refptr<OrderedSimpleTaskRunner> task_runner_;
+ scoped_ptr<BackToBackBeginFrameSource> begin_frame_source_;
SurfaceIdAllocator allocator_;
const gfx::Size display_size_;
« no previous file with comments | « cc/surfaces/surface_display_output_surface.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698