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

Unified Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2752303002: views/mus: Install a mus-friend ContextFactory for tests. (Closed)
Patch Set: . Created 3 years, 9 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/test/fake_compositor_frame_sink.h ('k') | mash/test/mash_test_suite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_compositor_frame_sink.cc
diff --git a/cc/test/fake_compositor_frame_sink.cc b/cc/test/fake_compositor_frame_sink.cc
index a4e19cb09524645460ddbb38a17323916769b298..ae75f85316a8c8060345bd23544eb5d3b20a2f24 100644
--- a/cc/test/fake_compositor_frame_sink.cc
+++ b/cc/test/fake_compositor_frame_sink.cc
@@ -8,6 +8,8 @@
#include "base/threading/thread_task_runner_handle.h"
#include "cc/output/compositor_frame_sink_client.h"
#include "cc/resources/returned_resource.h"
+#include "cc/scheduler/begin_frame_source.h"
+#include "cc/scheduler/delay_based_time_source.h"
#include "cc/test/begin_frame_args_test.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -29,6 +31,16 @@ FakeCompositorFrameSink::FakeCompositorFrameSink(
FakeCompositorFrameSink::~FakeCompositorFrameSink() = default;
+bool FakeCompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) {
+ if (!CompositorFrameSink::BindToClient(client))
+ return false;
+ begin_frame_source_ = base::MakeUnique<BackToBackBeginFrameSource>(
+ base::MakeUnique<DelayBasedTimeSource>(
+ base::ThreadTaskRunnerHandle::Get().get()));
+ client_->SetBeginFrameSource(begin_frame_source_.get());
+ return true;
+}
+
void FakeCompositorFrameSink::DetachFromClient() {
ReturnResourcesHeldByParent();
CompositorFrameSink::DetachFromClient();
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | mash/test/mash_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698