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

Unified Diff: cc/test/proxy_main_for_test.cc

Issue 1417053005: cc: Split ThreadProxy into ProxyMain and ProxyImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing brianderson@'s comments, remove benchmark name change. Created 5 years 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/proxy_main_for_test.h ('k') | cc/test/test_hooks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/proxy_main_for_test.cc
diff --git a/cc/test/proxy_main_for_test.cc b/cc/test/proxy_main_for_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4588422e09abaa642ce81edf087c8c0166170e01
--- /dev/null
+++ b/cc/test/proxy_main_for_test.cc
@@ -0,0 +1,104 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/proxy_main_for_test.h"
+
+#include "cc/test/threaded_channel_for_test.h"
+
+namespace cc {
+
+scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded(
+ TestHooks* test_hooks,
+ LayerTreeHost* host,
+ TaskRunnerProvider* task_runner_provider,
+ scoped_ptr<BeginFrameSource> external_begin_frame_source) {
+ scoped_ptr<ProxyMain> proxy_main(
+ new ProxyMainForTest(test_hooks, host, task_runner_provider,
+ std::move(external_begin_frame_source)));
+ proxy_main->SetChannel(ThreadedChannelForTest::Create(
+ test_hooks, proxy_main.get(), task_runner_provider));
+ return proxy_main;
+}
+
+ProxyMainForTest::~ProxyMainForTest() {}
+
+ProxyMainForTest::ProxyMainForTest(
+ TestHooks* test_hooks,
+ LayerTreeHost* host,
+ TaskRunnerProvider* task_runner_provider,
+ scoped_ptr<BeginFrameSource> external_begin_frame_source)
+ : ProxyMain(host,
+ task_runner_provider,
+ std::move(external_begin_frame_source)),
+ test_hooks_(test_hooks) {}
+
+void ProxyMainForTest::SetNeedsUpdateLayers() {
+ ProxyMain::SetNeedsUpdateLayers();
+ test_hooks_->DidSetNeedsUpdateLayers();
+}
+
+void ProxyMainForTest::DidCompleteSwapBuffers() {
+ test_hooks_->ReceivedDidCompleteSwapBuffers();
+ ProxyMain::DidCompleteSwapBuffers();
+}
+
+void ProxyMainForTest::SetRendererCapabilities(
+ const RendererCapabilities& capabilities) {
+ test_hooks_->ReceivedSetRendererCapabilitiesMainCopy(capabilities);
+ ProxyMain::SetRendererCapabilities(capabilities);
+}
+
+void ProxyMainForTest::BeginMainFrameNotExpectedSoon() {
+ test_hooks_->ReceivedBeginMainFrameNotExpectedSoon();
+ ProxyMain::BeginMainFrameNotExpectedSoon();
+}
+
+void ProxyMainForTest::DidCommitAndDrawFrame() {
+ test_hooks_->ReceivedDidCommitAndDrawFrame();
+ ProxyMain::DidCommitAndDrawFrame();
+}
+
+void ProxyMainForTest::SetAnimationEvents(
+ scoped_ptr<AnimationEventsVector> events) {
+ test_hooks_->ReceivedSetAnimationEvents();
+ ProxyMain::SetAnimationEvents(std::move(events));
+}
+
+void ProxyMainForTest::DidLoseOutputSurface() {
+ test_hooks_->ReceivedDidLoseOutputSurface();
+ ProxyMain::DidLoseOutputSurface();
+}
+
+void ProxyMainForTest::RequestNewOutputSurface() {
+ test_hooks_->ReceivedRequestNewOutputSurface();
+ ProxyMain::RequestNewOutputSurface();
+}
+
+void ProxyMainForTest::DidInitializeOutputSurface(
+ bool success,
+ const RendererCapabilities& capabilities) {
+ test_hooks_->ReceivedDidInitializeOutputSurface(success, capabilities);
+ ProxyMain::DidInitializeOutputSurface(success, capabilities);
+}
+
+void ProxyMainForTest::DidCompletePageScaleAnimation() {
+ test_hooks_->ReceivedDidCompletePageScaleAnimation();
+ ProxyMain::DidCompletePageScaleAnimation();
+}
+
+void ProxyMainForTest::PostFrameTimingEventsOnMain(
+ scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
+ scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
+ test_hooks_->ReceivedPostFrameTimingEventsOnMain();
+ ProxyMain::PostFrameTimingEventsOnMain(std::move(composite_events),
+ std::move(main_frame_events));
+}
+
+void ProxyMainForTest::BeginMainFrame(
+ scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) {
+ test_hooks_->ReceivedBeginMainFrame();
+ ProxyMain::BeginMainFrame(std::move(begin_main_frame_state));
+}
+
+} // namespace cc
« no previous file with comments | « cc/test/proxy_main_for_test.h ('k') | cc/test/test_hooks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698