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

Unified Diff: cc/test/layer_tree_test.h

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LayerTreeSettings::ToProtobuf, update comments. 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
Index: cc/test/layer_tree_test.h
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index ea509d5f81e12cc3781c62375d6c196cbd912dcf..3afe4d3ef0457d82841e61a2f9d9c1d37fc110c3 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -11,6 +11,7 @@
#include "cc/layers/layer_settings.h"
#include "cc/test/proxy_impl_for_test.h"
#include "cc/test/proxy_main_for_test.h"
+#include "cc/test/remote_proto_channel_bridge.h"
#include "cc/test/test_hooks.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_impl.h"
@@ -25,10 +26,14 @@ class LayerImpl;
class LayerTreeHost;
class LayerTreeHostClient;
class LayerTreeHostImpl;
+class RemoteChannelHostClientForTesting;
+class RemoteChannelHostForTesting;
+class RemoteChannelImplForTest;
class TestContextProvider;
class TestGpuMemoryBufferManager;
class TestTaskGraphRunner;
class TestWebGraphicsContext3D;
+class ThreadedChannelForTest;
// Creates the virtual viewport layer hierarchy under the given root_layer.
// Convenient overload of the method below that creates a scrolling layer as
@@ -129,7 +134,6 @@ class LayerTreeTest : public testing::Test, public TestHooks {
virtual void BeginTest() = 0;
virtual void SetupTree();
- // TODO(khushalsagar): Add mode for running remote channel tests.
virtual void RunTest(CompositorMode mode, bool delegating_renderer);
bool HasImplThread() const { return !!impl_thread_; }
@@ -158,13 +162,18 @@ class LayerTreeTest : public testing::Test, public TestHooks {
FakeOutputSurface* output_surface() { return output_surface_; }
int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const;
- // Use these only for ProxyMain tests in threaded mode.
- // TODO(khushalsagar): Update these when adding support for remote channel
- // tests.
+ // Use these only for tests in threaded or remote mode.
ProxyMainForTest* GetProxyMainForTest() const;
ProxyImplForTest* GetProxyImplForTest() const;
+ // Use this only for tests in threaded mode.
+ ThreadedChannelForTest* GetThreadedChannelForTest() const;
+
+ // Use this only for tests in remote mode.
+ RemoteChannelImplForTest* GetRemoteChannelImplForTest() const;
+
void DestroyLayerTreeHost();
+ void DestroyRemoteChannelHost();
// By default, output surface recreation is synchronous.
void RequestNewOutputSurface() override;
@@ -179,7 +188,11 @@ class LayerTreeTest : public testing::Test, public TestHooks {
return gpu_memory_buffer_manager_.get();
}
+ bool IsRemoteTest() const;
+
private:
+ void DidShutdown() override;
+
LayerTreeSettings settings_;
LayerSettings layer_settings_;
@@ -187,8 +200,11 @@ class LayerTreeTest : public testing::Test, public TestHooks {
scoped_ptr<LayerTreeHostClientForTesting> client_;
scoped_ptr<LayerTreeHost> layer_tree_host_;
+ scoped_ptr<RemoteChannelHostClientForTesting> remote_channel_host_client_;
+ scoped_ptr<RemoteChannelHostForTesting> remote_channel_host_for_testing_;
FakeOutputSurface* output_surface_;
FakeExternalBeginFrameSource* external_begin_frame_source_;
+ RemoteProtoChannelBridge remote_proto_channel_bridge_;
bool beginning_;
bool end_when_begin_returns_;
@@ -246,6 +262,13 @@ class LayerTreeTest : public testing::Test, public TestHooks {
MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
+// The Remote mode tests don't need to run for delegated renderer.
+#define REMOTE_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
+ TEST_F(TEST_FIXTURE_NAME, RunRemote_DirectRenderer) { \
+ RunTest(CompositorMode::Remote, false); \
+ } \
+ class RemoteDirectImplNeedsSemicolon##TEST_FIXTURE_NAME {}
+
#define SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME)

Powered by Google App Engine
This is Rietveld 408576698