[go: nahoru, domu]

Enable more cc unit tests for LayerTreeHostRemote test.

We have added test classes for LayerTreeHostRemote for Blimp and would
like to reuse cc unit tests to test the following flow:

Engine cc ==> Client cc main thread ==> Client cc impl thread.

This CL goes through about 50 unit test cases in
layer_tree_host_unittest.cc.

BUG=653371
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2456093003
Cr-Commit-Position: refs/heads/master@{#429396}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index bd968591..48bacc2 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -730,6 +730,10 @@
     "test/pixel_test_output_surface.h",
     "test/pixel_test_utils.cc",
     "test/pixel_test_utils.h",
+    "test/push_properties_counting_layer.cc",
+    "test/push_properties_counting_layer.h",
+    "test/push_properties_counting_layer_impl.cc",
+    "test/push_properties_counting_layer_impl.h",
     "test/remote_client_layer_factory.cc",
     "test/remote_client_layer_factory.h",
     "test/remote_proto_channel_bridge.cc",
diff --git a/cc/blimp/compositor_state_deserializer.cc b/cc/blimp/compositor_state_deserializer.cc
index 1c1f82fb..f83d9ef 100644
--- a/cc/blimp/compositor_state_deserializer.cc
+++ b/cc/blimp/compositor_state_deserializer.cc
@@ -38,15 +38,6 @@
       ContentLayerClient* content_layer_client) override {
     return PictureLayer::Create(content_layer_client);
   }
-
-  scoped_refptr<PictureLayer> CreateFakePictureLayer(
-      int engine_layer_id,
-      ContentLayerClient* content_layer_client) override {
-    // We should never create fake layers in production code.
-    NOTREACHED();
-    return PictureLayer::Create(content_layer_client);
-  }
-
   scoped_refptr<SolidColorScrollbarLayer> CreateSolidColorScrollbarLayer(
       int engine_layer_id,
       ScrollbarOrientation orientation,
@@ -58,6 +49,19 @@
         orientation, thumb_thickness, track_start,
         is_left_side_vertical_scrollbar, scroll_layer_id);
   }
+  scoped_refptr<PictureLayer> CreateFakePictureLayer(
+      int engine_layer_id,
+      ContentLayerClient* content_layer_client) override {
+    // We should never create fake layers in production code.
+    NOTREACHED();
+    return PictureLayer::Create(content_layer_client);
+  }
+  scoped_refptr<Layer> CreatePushPropertiesCountingLayer(
+      int engine_layer_id) override {
+    // We should never create fake layers in production code.
+    NOTREACHED();
+    return Layer::Create();
+  }
 };
 
 }  // namespace
@@ -371,6 +375,7 @@
           layer_node.id(), layer_data.content_layer_client.get());
       break;
     case proto::LayerNode::FAKE_PICTURE_LAYER:
+      // FAKE_PICTURE_LAYER is for testing only.
       layer_data.content_layer_client =
           base::MakeUnique<DeserializedContentLayerClient>();
       layer_data.layer = layer_factory_->CreateFakePictureLayer(
@@ -403,6 +408,12 @@
     case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
       // TODO(khushalsagar): Remove this from proto.
       NOTREACHED();
+      break;
+    case proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER:
+      // PUSH_PROPERTIES_COUNTING_LAYER is for testing only.
+      layer_data.layer =
+          layer_factory_->CreatePushPropertiesCountingLayer(layer_node.id());
+      break;
   }
 
   layer = layer_data.layer;
diff --git a/cc/blimp/layer_factory.h b/cc/blimp/layer_factory.h
index 6d5bbf14..0c0c88c 100644
--- a/cc/blimp/layer_factory.h
+++ b/cc/blimp/layer_factory.h
@@ -27,10 +27,6 @@
       int engine_layer_id,
       ContentLayerClient* content_layer_client) = 0;
 
-  virtual scoped_refptr<PictureLayer> CreateFakePictureLayer(
-      int engine_layer_id,
-      ContentLayerClient* content_layer_client) = 0;
-
   virtual scoped_refptr<SolidColorScrollbarLayer>
   CreateSolidColorScrollbarLayer(int engine_layer_id,
                                  ScrollbarOrientation orientation,
@@ -38,6 +34,14 @@
                                  int track_start,
                                  bool is_left_side_vertical_scrollbar,
                                  int scroll_layer_id) = 0;
+
+  // Create layers for testing.
+  virtual scoped_refptr<PictureLayer> CreateFakePictureLayer(
+      int engine_layer_id,
+      ContentLayerClient* content_layer_client) = 0;
+
+  virtual scoped_refptr<Layer> CreatePushPropertiesCountingLayer(
+      int engine_layer_id) = 0;
 };
 
 }  // namespace cc
diff --git a/cc/blimp/layer_tree_host_remote.cc b/cc/blimp/layer_tree_host_remote.cc
index fb7439b5..290a601 100644
--- a/cc/blimp/layer_tree_host_remote.cc
+++ b/cc/blimp/layer_tree_host_remote.cc
@@ -515,10 +515,13 @@
                           inputs_only);
 
   // Serialize the dirty layers.
-  for (auto* layer : layer_tree_->LayersThatShouldPushProperties())
+  std::unordered_set<Layer*> layers_need_push_properties;
+  layers_need_push_properties.swap(
+      layer_tree_->LayersThatShouldPushProperties());
+
+  for (auto* layer : layers_need_push_properties)
     layer->ToLayerPropertiesProto(
         layer_tree_host_proto->mutable_layer_updates(), inputs_only);
-  layer_tree_->LayersThatShouldPushProperties().clear();
 
   std::vector<PictureData> pictures =
       engine_picture_cache_->CalculateCacheUpdateAndFlush();
diff --git a/cc/blimp/layer_tree_host_remote_unittest.cc b/cc/blimp/layer_tree_host_remote_unittest.cc
index efb2ed9..b6cbdcd 100644
--- a/cc/blimp/layer_tree_host_remote_unittest.cc
+++ b/cc/blimp/layer_tree_host_remote_unittest.cc
@@ -4,12 +4,16 @@
 
 #include "cc/blimp/layer_tree_host_remote.h"
 
+#include <memory>
+#include <unordered_set>
+
 #include "base/bind.h"
 #include "base/run_loop.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "cc/animation/animation_host.h"
 #include "cc/layers/layer.h"
 #include "cc/output/begin_frame_args.h"
+#include "cc/proto/compositor_message.pb.h"
 #include "cc/test/fake_image_serialization_processor.h"
 #include "cc/test/fake_remote_compositor_bridge.h"
 #include "cc/test/stub_layer_tree_host_client.h"
@@ -48,6 +52,7 @@
   void ProcessCompositorStateUpdate(
       std::unique_ptr<CompositorProtoState> compositor_proto_state) override {
     num_updates_received_++;
+    compositor_proto_state_ = std::move(compositor_proto_state);
   };
 
   bool SendUpdates(const std::unordered_map<int, gfx::ScrollOffset>& scroll_map,
@@ -57,8 +62,13 @@
 
   int num_updates_received() const { return num_updates_received_; }
 
+  CompositorProtoState* compositor_proto_state() {
+    return compositor_proto_state_.get();
+  }
+
  private:
   int num_updates_received_ = 0;
+  std::unique_ptr<CompositorProtoState> compositor_proto_state_;
 };
 
 class MockLayerTreeHostClient : public StubLayerTreeHostClient {
@@ -456,5 +466,54 @@
   EXPECT_TRUE(updated_layer->did_update());
 }
 
+TEST_F(LayerTreeHostRemoteTest, OnlyPushPropertiesOnChangingLayers) {
+  EXPECT_BEGIN_MAIN_FRAME_AND_COMMIT(mock_layer_tree_host_client_, 2);
+
+  // Setup a tree with 3 nodes.
+  scoped_refptr<Layer> child_layer = Layer::Create();
+  scoped_refptr<Layer> grandchild_layer = Layer::Create();
+  root_layer_->AddChild(child_layer);
+  child_layer->AddChild(grandchild_layer);
+  layer_tree_host_->SetNeedsCommit();
+
+  base::RunLoop().RunUntilIdle();
+
+  // Ensure the first proto contains all layer updates.
+  EXPECT_EQ(1, remote_compositor_bridge_->num_updates_received());
+  CompositorProtoState* compositor_proto_state =
+      remote_compositor_bridge_->compositor_proto_state();
+  const proto::LayerUpdate& layer_updates_first_commit =
+      compositor_proto_state->compositor_message->layer_tree_host()
+          .layer_updates();
+
+  std::unordered_set<int> layer_updates_id_set;
+  for (int i = 0; i < layer_updates_first_commit.layers_size(); ++i) {
+    layer_updates_id_set.insert(layer_updates_first_commit.layers(i).id());
+  }
+
+  EXPECT_TRUE(layer_updates_id_set.find(root_layer_->id()) !=
+              layer_updates_id_set.end());
+  EXPECT_TRUE(layer_updates_id_set.find(child_layer->id()) !=
+              layer_updates_id_set.end());
+  EXPECT_TRUE(layer_updates_id_set.find(grandchild_layer->id()) !=
+              layer_updates_id_set.end());
+  EXPECT_EQ(3, layer_updates_first_commit.layers_size());
+
+  // Modify the |child_layer|, and run the second frame.
+  child_layer->SetNeedsPushProperties();
+  layer_tree_host_->SetNeedsCommit();
+  base::RunLoop().RunUntilIdle();
+
+  // Ensure the second proto only contains |child_layer|.
+  EXPECT_EQ(2, remote_compositor_bridge_->num_updates_received());
+  compositor_proto_state = remote_compositor_bridge_->compositor_proto_state();
+  DCHECK(compositor_proto_state);
+  const proto::LayerUpdate& layer_updates_second_commit =
+      compositor_proto_state->compositor_message->layer_tree_host()
+          .layer_updates();
+  EXPECT_EQ(1, layer_updates_second_commit.layers_size());
+  EXPECT_EQ(child_layer->id(), layer_updates_second_commit.layers(0).id());
+}
+
 }  // namespace
 }  // namespace cc
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 8c8d991..d1b9663 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -377,8 +377,8 @@
   // a LayerImpl, it pushes the properties to proto::LayerProperties. It is
   // called only on layers that have changed properties. The properties
   // themselves are pushed to proto::LayerProperties.
-  void ToLayerPropertiesProto(proto::LayerUpdate* layer_update,
-                              bool inputs_only);
+  virtual void ToLayerPropertiesProto(proto::LayerUpdate* layer_update,
+                                      bool inputs_only);
 
   // Read all property values from the given LayerProperties object and update
   // the current layer. The values for |needs_push_properties_| and
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index c515cba..f11ec38 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -97,6 +97,7 @@
     // layer type we don't support.
     case proto::LayerNode::UNKNOWN:
     case proto::LayerNode::LAYER:
+    case proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER:
       return Layer::Create().get();
     case proto::LayerNode::PICTURE_LAYER:
     case proto::LayerNode::FAKE_PICTURE_LAYER:
diff --git a/cc/proto/layer.proto b/cc/proto/layer.proto
index dfb188d..c8c6b84 100644
--- a/cc/proto/layer.proto
+++ b/cc/proto/layer.proto
@@ -35,6 +35,7 @@
 
     // Layer Types for testing only.
     FAKE_PICTURE_LAYER = 5;
+    PUSH_PROPERTIES_COUNTING_LAYER = 6;
 
     // TODO(nyquist): Add the rest of the necessary LayerTypes.
   };
diff --git a/cc/test/push_properties_counting_layer.cc b/cc/test/push_properties_counting_layer.cc
new file mode 100644
index 0000000..cb0bf3c
--- /dev/null
+++ b/cc/test/push_properties_counting_layer.cc
@@ -0,0 +1,57 @@
+// Copyright 2016 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/push_properties_counting_layer.h"
+
+#include "cc/test/push_properties_counting_layer_impl.h"
+
+namespace cc {
+
+// static
+scoped_refptr<PushPropertiesCountingLayer>
+PushPropertiesCountingLayer::Create() {
+  return new PushPropertiesCountingLayer();
+}
+
+PushPropertiesCountingLayer::PushPropertiesCountingLayer()
+    : push_properties_count_(0), persist_needs_push_properties_(false) {
+  SetBounds(gfx::Size(1, 1));
+}
+
+PushPropertiesCountingLayer::~PushPropertiesCountingLayer() = default;
+
+void PushPropertiesCountingLayer::PushPropertiesTo(LayerImpl* layer) {
+  Layer::PushPropertiesTo(layer);
+  AddPushPropertiesCount();
+}
+
+std::unique_ptr<LayerImpl> PushPropertiesCountingLayer::CreateLayerImpl(
+    LayerTreeImpl* tree_impl) {
+  return PushPropertiesCountingLayerImpl::Create(tree_impl, Layer::id());
+}
+
+void PushPropertiesCountingLayer::ToLayerPropertiesProto(
+    proto::LayerUpdate* layer_update,
+    bool inputs_only) {
+  Layer::ToLayerPropertiesProto(layer_update, inputs_only);
+  AddPushPropertiesCount();
+}
+
+void PushPropertiesCountingLayer::SetTypeForProtoSerialization(
+    proto::LayerNode* proto) const {
+  proto->set_type(proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER);
+}
+
+void PushPropertiesCountingLayer::MakePushProperties() {
+  SetContentsOpaque(!contents_opaque());
+}
+
+void PushPropertiesCountingLayer::AddPushPropertiesCount() {
+  push_properties_count_++;
+  if (persist_needs_push_properties_) {
+    GetLayerTree()->AddLayerShouldPushProperties(this);
+  }
+}
+
+}  // namespace cc
diff --git a/cc/test/push_properties_counting_layer.h b/cc/test/push_properties_counting_layer.h
new file mode 100644
index 0000000..76d2e750
--- /dev/null
+++ b/cc/test/push_properties_counting_layer.h
@@ -0,0 +1,55 @@
+// Copyright 2016 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.
+
+#ifndef CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_
+#define CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "cc/layers/layer.h"
+#include "cc/proto/layer.pb.h"
+
+namespace cc {
+
+class LayerImpl;
+class LayerTreeImpl;
+
+class PushPropertiesCountingLayer : public Layer {
+ public:
+  static scoped_refptr<PushPropertiesCountingLayer> Create();
+
+  // Layer implementation.
+  void PushPropertiesTo(LayerImpl* layer) override;
+  std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
+  void ToLayerPropertiesProto(proto::LayerUpdate* layer_update,
+                              bool inputs_only) override;
+  void SetTypeForProtoSerialization(proto::LayerNode* proto) const override;
+
+  // Something to make this layer push properties, but no other layer.
+  void MakePushProperties();
+
+  size_t push_properties_count() const { return push_properties_count_; }
+  void reset_push_properties_count() { push_properties_count_ = 0; }
+
+  void set_persist_needs_push_properties(bool persist) {
+    persist_needs_push_properties_ = persist;
+  }
+
+ private:
+  PushPropertiesCountingLayer();
+  ~PushPropertiesCountingLayer() override;
+
+  void AddPushPropertiesCount();
+
+  size_t push_properties_count_;
+  bool persist_needs_push_properties_;
+
+  DISALLOW_COPY_AND_ASSIGN(PushPropertiesCountingLayer);
+};
+
+}  // namespace cc
+
+#endif  // CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_
diff --git a/cc/test/push_properties_counting_layer_impl.cc b/cc/test/push_properties_counting_layer_impl.cc
new file mode 100644
index 0000000..52331708
--- /dev/null
+++ b/cc/test/push_properties_counting_layer_impl.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 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/push_properties_counting_layer_impl.h"
+
+namespace cc {
+
+// static
+std::unique_ptr<PushPropertiesCountingLayerImpl>
+PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) {
+  return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
+}
+
+PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl(
+    LayerTreeImpl* tree_impl,
+    int id)
+    : LayerImpl(tree_impl, id), push_properties_count_(0) {
+  SetBounds(gfx::Size(1, 1));
+}
+
+PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default;
+
+void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) {
+  LayerImpl::PushPropertiesTo(layer);
+  push_properties_count_++;
+  // Push state to the active tree because we can only access it from there.
+  static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ =
+      push_properties_count_;
+}
+
+std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl(
+    LayerTreeImpl* tree_impl) {
+  return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id());
+}
+
+}  // namespace cc
diff --git a/cc/test/push_properties_counting_layer_impl.h b/cc/test/push_properties_counting_layer_impl.h
new file mode 100644
index 0000000..1112552
--- /dev/null
+++ b/cc/test/push_properties_counting_layer_impl.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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.
+
+#ifndef CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_IMPL_H_
+#define CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_IMPL_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+#include "cc/layers/layer_impl.h"
+
+namespace cc {
+
+class LayerTreeImpl;
+
+class PushPropertiesCountingLayerImpl : public LayerImpl {
+ public:
+  static std::unique_ptr<PushPropertiesCountingLayerImpl> Create(
+      LayerTreeImpl* tree_impl,
+      int id);
+  ~PushPropertiesCountingLayerImpl() override;
+
+  // LayerImpl implementation.
+  void PushPropertiesTo(LayerImpl* layer) override;
+  std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
+
+  size_t push_properties_count() const { return push_properties_count_; }
+  void reset_push_properties_count() { push_properties_count_ = 0; }
+
+ private:
+  PushPropertiesCountingLayerImpl(LayerTreeImpl* tree_impl, int id);
+
+  size_t push_properties_count_;
+
+  DISALLOW_COPY_AND_ASSIGN(PushPropertiesCountingLayerImpl);
+};
+
+}  // namespace cc
+
+#endif  // CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_IMPL_H_
diff --git a/cc/test/remote_client_layer_factory.cc b/cc/test/remote_client_layer_factory.cc
index cc7fd9f..3ac6b04 100644
--- a/cc/test/remote_client_layer_factory.cc
+++ b/cc/test/remote_client_layer_factory.cc
@@ -8,6 +8,7 @@
 #include "cc/layers/picture_layer.h"
 #include "cc/layers/solid_color_scrollbar_layer.h"
 #include "cc/test/fake_picture_layer.h"
+#include "cc/test/push_properties_counting_layer.h"
 
 namespace cc {
 
@@ -31,15 +32,6 @@
   return layer;
 }
 
-scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreateFakePictureLayer(
-    int engine_layer_id,
-    ContentLayerClient* content_layer_client) {
-  scoped_refptr<PictureLayer> layer =
-      FakePictureLayer::Create(content_layer_client);
-  layer->SetLayerIdForTesting(engine_layer_id);
-  return layer;
-}
-
 scoped_refptr<SolidColorScrollbarLayer>
 RemoteClientLayerFactory::CreateSolidColorScrollbarLayer(
     int engine_layer_id,
@@ -56,4 +48,22 @@
   return layer;
 }
 
+scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreateFakePictureLayer(
+    int engine_layer_id,
+    ContentLayerClient* content_layer_client) {
+  scoped_refptr<PictureLayer> layer =
+      FakePictureLayer::Create(content_layer_client);
+  layer->SetLayerIdForTesting(engine_layer_id);
+  return layer;
+}
+
+scoped_refptr<Layer>
+RemoteClientLayerFactory::CreatePushPropertiesCountingLayer(
+    int engine_layer_id) {
+  scoped_refptr<PushPropertiesCountingLayer> layer =
+      PushPropertiesCountingLayer::Create();
+  layer->SetLayerIdForTesting(engine_layer_id);
+  return layer;
+}
+
 }  // namespace cc
diff --git a/cc/test/remote_client_layer_factory.h b/cc/test/remote_client_layer_factory.h
index a02d17e..22f1ebe 100644
--- a/cc/test/remote_client_layer_factory.h
+++ b/cc/test/remote_client_layer_factory.h
@@ -23,9 +23,6 @@
   scoped_refptr<PictureLayer> CreatePictureLayer(
       int engine_layer_id,
       ContentLayerClient* content_layer_client) override;
-  scoped_refptr<PictureLayer> CreateFakePictureLayer(
-      int engine_layer_id,
-      ContentLayerClient* content_layer_client) override;
   scoped_refptr<SolidColorScrollbarLayer> CreateSolidColorScrollbarLayer(
       int engine_layer_id,
       ScrollbarOrientation orientation,
@@ -33,6 +30,11 @@
       int track_start,
       bool is_left_side_vertical_scrollbar,
       int scroll_layer_id) override;
+  scoped_refptr<PictureLayer> CreateFakePictureLayer(
+      int engine_layer_id,
+      ContentLayerClient* content_layer_client) override;
+  scoped_refptr<Layer> CreatePushPropertiesCountingLayer(
+      int engine_layer_id) override;
 };
 
 }  // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 53eadb8..3a7caa666 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -47,6 +47,8 @@
 #include "cc/test/geometry_test_utils.h"
 #include "cc/test/layer_internals_for_test.h"
 #include "cc/test/layer_tree_test.h"
+#include "cc/test/push_properties_counting_layer.h"
+#include "cc/test/push_properties_counting_layer_impl.h"
 #include "cc/test/render_pass_test_utils.h"
 #include "cc/test/skia_common.h"
 #include "cc/test/test_compositor_frame_sink.h"
@@ -286,10 +288,7 @@
 
 // No single thread test because the commit goes directly to the active tree in
 // single thread mode, so notify ready to activate is skipped.
-// No remote test because we currently don't deserialize FakePictureLayer,
-// so on the impl side, PictureLayerImpl is created instead of
-// FakePictureLayerImpl, see crbug/657871.
-MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
 
 // Test if the LTHI receives ReadyToDraw notifications from the TileManager when
 // no raster tasks get scheduled.
@@ -1623,7 +1622,7 @@
 
 // As there's no pending tree in single-threaded case, this test should run
 // only for multi-threaded case.
-MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged);
 
 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
  public:
@@ -1673,7 +1672,7 @@
   scoped_refptr<Layer> scaled_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate);
 
 class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
     : public LayerTreeHostTest {
@@ -1730,6 +1729,8 @@
   scoped_refptr<FakePaintedScrollbarLayer> scrollbar_;
 };
 
+// No remote test here because PaintedScrollbarLayer is not supported by LTH
+// remote.
 SINGLE_AND_MULTI_THREAD_TEST_F(
     LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate);
 
@@ -1797,7 +1798,7 @@
   scoped_refptr<Layer> child_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorChange);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDeviceScaleFactorChange);
 
 class LayerTreeHostTestDeviceColorSpaceChange : public LayerTreeHostTest {
  public:
@@ -1920,6 +1921,9 @@
   scoped_refptr<Layer> child_layer_;
 };
 
+// No remote test because LTH remote doesn't serialize device_color_space, so
+// LTH in process will always use the default color space here.
+// see crbug/658786.
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceColorSpaceChange);
 
 class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
@@ -2010,6 +2014,7 @@
 
 // This test blocks activation which is not supported for single thread mode.
 MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
+REMOTE_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
 
 // Tests that if a layer is not drawn because of some reason in the parent then
 // its damage is preserved until the next time it is drawn.
@@ -2106,7 +2111,7 @@
   scoped_refptr<FakePictureLayer> child_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUndrawnLayersDamageLater);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestUndrawnLayersDamageLater);
 
 // Tests that if a layer is not drawn because of some reason in the parent then
 // its damage is preserved until the next time it is drawn.
@@ -2211,7 +2216,7 @@
   scoped_refptr<Layer> child_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithScale);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDamageWithScale);
 
 // This test verifies that properties on the layer tree host are commited
 // to the impl side.
@@ -2255,7 +2260,7 @@
   void AfterTest() override {}
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
 
 // This test verifies that LayerTreeHostImpl's current frame time gets
 // updated in consecutive frames when it doesn't draw due to tree
@@ -2313,6 +2318,7 @@
 // This test blocks activation which is not supported for single thread mode.
 MULTI_THREAD_BLOCKNOTIFY_TEST_F(
     LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
+REMOTE_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
 
 // This test verifies that LayerTreeHostImpl's current frame time gets
 // updated in consecutive frames when it draws in each frame.
@@ -2361,7 +2367,7 @@
   base::TimeTicks first_frame_time_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterDraw);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterDraw);
 
 // Verifies that StartPageScaleAnimation events propagate correctly
 // from LayerTreeHost to LayerTreeHostImpl in the MT compositor.
@@ -2439,6 +2445,7 @@
 };
 
 // Single thread proxy does not support impl-side page scale changes.
+// Remote test does not support page scale animation.
 MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation);
 
 class LayerTreeHostTestSetVisible : public LayerTreeHostTest {
@@ -2469,7 +2476,7 @@
   int num_draws_;
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible);
 
 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
     : public LayerTreeHostTest {
@@ -2571,7 +2578,8 @@
   scoped_refptr<FakePictureLayer> child_layer_;
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
+REMOTE_AND_MULTI_THREAD_TEST_F(
+    LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
 
 class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
  public:
@@ -2621,7 +2629,7 @@
   int num_draw_layers_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousInvalidate);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestContinuousInvalidate);
 
 class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
  public:
@@ -2679,7 +2687,7 @@
   int num_send_begin_main_frame_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDeferCommits);
 
 class LayerTreeHostTestCompositeImmediatelyStateTransitions
     : public LayerTreeHostTest {
@@ -2838,7 +2846,7 @@
   int num_tiles_rastered_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLCDChange);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestLCDChange);
 
 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
     : public LayerTreeHostTest {
@@ -2860,6 +2868,8 @@
   void AfterTest() override {}
 };
 
+// No remote test since synchronous renderer compositor is not supported for LTH
+// remote.
 MULTI_THREAD_TEST_F(
     LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
 
@@ -2984,6 +2994,8 @@
   OnDrawCompositorFrameSink* compositor_frame_sink_ = nullptr;
 };
 
+// No remote test since synchronous renderer compositor is not supported for LTH
+// remote.
 MULTI_THREAD_TEST_F(
     LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor);
 
@@ -3011,7 +3023,7 @@
   FakeContentLayerClient client_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_MULTI_AND_REMOTE_TEST_F(
     LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation);
 
 class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
@@ -3060,7 +3072,7 @@
   int frame_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNumFramesPending);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestNumFramesPending);
 
 class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest {
  protected:
@@ -3166,6 +3178,8 @@
 };
 
 // Resourceless is not used for SingleThreadProxy, so it is unimplemented.
+// No remote test since synchronous renderer compositor is not supported for LTH
+// remote.
 MULTI_THREAD_TEST_F(LayerTreeHostTestResourcelessSoftwareDraw);
 
 // Test for UI Resource management.
@@ -3262,85 +3276,10 @@
   int num_ui_resources_;
 };
 
+// No remote test since LTH remote does not support UIResourceLayers and
+// PaintedScrollbarLayers, which uses UIResourceManager.
 MULTI_THREAD_TEST_F(LayerTreeHostTestUIResource);
 
-class PushPropertiesCountingLayerImpl : public LayerImpl {
- public:
-  static std::unique_ptr<PushPropertiesCountingLayerImpl> Create(
-      LayerTreeImpl* tree_impl,
-      int id) {
-    return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
-  }
-
-  ~PushPropertiesCountingLayerImpl() override {}
-
-  void PushPropertiesTo(LayerImpl* layer) override {
-    LayerImpl::PushPropertiesTo(layer);
-    push_properties_count_++;
-    // Push state to the active tree because we can only access it from there.
-    static_cast<PushPropertiesCountingLayerImpl*>(layer)
-        ->push_properties_count_ = push_properties_count_;
-  }
-
-  std::unique_ptr<LayerImpl> CreateLayerImpl(
-      LayerTreeImpl* tree_impl) override {
-    return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
-  }
-
-  size_t push_properties_count() const { return push_properties_count_; }
-  void reset_push_properties_count() { push_properties_count_ = 0; }
-
- private:
-  size_t push_properties_count_;
-
-  PushPropertiesCountingLayerImpl(LayerTreeImpl* tree_impl, int id)
-      : LayerImpl(tree_impl, id), push_properties_count_(0) {
-    SetBounds(gfx::Size(1, 1));
-  }
-};
-
-class PushPropertiesCountingLayer : public Layer {
- public:
-  static scoped_refptr<PushPropertiesCountingLayer> Create() {
-    return new PushPropertiesCountingLayer();
-  }
-
-  void PushPropertiesTo(LayerImpl* layer) override {
-    Layer::PushPropertiesTo(layer);
-    push_properties_count_++;
-    if (persist_needs_push_properties_) {
-      GetLayerTree()->AddLayerShouldPushProperties(this);
-    }
-  }
-
-  // Something to make this layer push properties, but no other layer.
-  void MakePushProperties() { SetContentsOpaque(!contents_opaque()); }
-
-  std::unique_ptr<LayerImpl> CreateLayerImpl(
-      LayerTreeImpl* tree_impl) override {
-    return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
-  }
-
-  void SetDrawsContent(bool draws_content) { SetIsDrawable(draws_content); }
-
-  size_t push_properties_count() const { return push_properties_count_; }
-  void reset_push_properties_count() { push_properties_count_ = 0; }
-
-  void set_persist_needs_push_properties(bool persist) {
-    persist_needs_push_properties_ = persist;
-  }
-
- private:
-  PushPropertiesCountingLayer()
-      : push_properties_count_(0), persist_needs_push_properties_(false) {
-    SetBounds(gfx::Size(1, 1));
-  }
-  ~PushPropertiesCountingLayer() override {}
-
-  size_t push_properties_count_;
-  bool persist_needs_push_properties_;
-};
-
 class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
  protected:
   void BeginTest() override {
@@ -3541,6 +3480,9 @@
   size_t expected_push_properties_leaf_layer_;
 };
 
+// No remote test because LTH remote does not build property trees, so layers
+// to push properties are different between engine and client.
+// See crbug/655795.
 MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties);
 
 class LayerTreeHostTestImplLayersPushProperties
@@ -3737,7 +3679,9 @@
   size_t expected_push_properties_grandchild2_impl_;
 };
 
-// In single thread there's no pending tree to push properties from.
+// No remote test because LTH remote does not build property trees, so layers
+// to push properties are different between engine and client.
+// See crbug/655795.
 MULTI_THREAD_TEST_F(LayerTreeHostTestImplLayersPushProperties);
 
 class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
@@ -3795,6 +3739,7 @@
   scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_;
 };
 
+// No remote test since remote LTH does not support PaintedScrollbarLayer.
 MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed);
 
 class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
@@ -3826,7 +3771,7 @@
         EXPECT_EQ(0, root_->NumDescendantsThatDrawContent());
         root_->reset_push_properties_count();
         child_->reset_push_properties_count();
-        child_->SetDrawsContent(true);
+        child_->SetIsDrawable(true);
         EXPECT_EQ(1, root_->NumDescendantsThatDrawContent());
         EXPECT_EQ(0u, root_->push_properties_count());
         EXPECT_EQ(0u, child_->push_properties_count());
@@ -3855,7 +3800,7 @@
   scoped_refptr<PushPropertiesCountingLayer> child_;
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit);
 
 class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
     : public LayerTreeHostTest {
@@ -3928,7 +3873,8 @@
   }
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush);
+REMOTE_AND_MULTI_THREAD_TEST_F(
+    LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush);
 
 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
@@ -4011,7 +3957,8 @@
   }
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion);
+REMOTE_AND_MULTI_THREAD_TEST_F(
+    LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion);
 
 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
@@ -4059,7 +4006,7 @@
   }
 };
 
-MULTI_THREAD_TEST_F(
+REMOTE_AND_MULTI_THREAD_TEST_F(
     LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence);
 
 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
@@ -4128,7 +4075,7 @@
   }
 };
 
-MULTI_THREAD_TEST_F(
+REMOTE_AND_MULTI_THREAD_TEST_F(
     LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree);
 
 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
@@ -4193,7 +4140,7 @@
   }
 };
 
-MULTI_THREAD_TEST_F(
+REMOTE_AND_MULTI_THREAD_TEST_F(
     LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild);
 
 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
@@ -4258,7 +4205,7 @@
   }
 };
 
-MULTI_THREAD_TEST_F(
+REMOTE_AND_MULTI_THREAD_TEST_F(
     LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent);
 
 // This test verifies that the tree activation callback is invoked correctly.
@@ -4317,7 +4264,7 @@
   int callback_count_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTreeActivationCallback);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestTreeActivationCallback);
 
 class LayerInvalidateCausesDraw : public LayerTreeHostTest {
  public:
@@ -4380,6 +4327,7 @@
   FakeVideoFrameProvider provider_;
 };
 
+// LTH remote does not support VideoLayer.
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
 
 class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
@@ -4447,7 +4395,7 @@
   scoped_refptr<SolidColorLayer> child_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushHiddenLayer);
+SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestPushHiddenLayer);
 
 class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
  protected:
@@ -4480,7 +4428,7 @@
   scoped_refptr<FakePictureLayer> root_layer_;
 };
 
-MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport);
+REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport);
 
 class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest {
  public:
@@ -4575,6 +4523,7 @@
   int num_draws_;
 };
 
+// Remote test does not support enable_elastic_overscroll.
 MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll);
 
 struct TestSwapPromiseResult {
@@ -4679,6 +4628,9 @@
   TestSwapPromiseResult pinned_active_swap_promise_result_;
 };
 
+// No remote test because this test compares the swap promises result between
+// LTH in process and LTH impl. LTH remote runs its own swap promise, and we
+// don't send swap promises to the client.
 MULTI_THREAD_TEST_F(PinnedLayerTreeSwapPromise);
 
 class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
@@ -4776,6 +4728,8 @@
   TestSwapPromiseResult swap_promise_result_[3];
 };
 
+// No remote test because LTH remote runs its own swap promises, and we
+// don't send swap promises to the LTH in process on the client side.
 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
 
 class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest {
@@ -4867,6 +4821,8 @@
   TestSwapPromiseResult swap_promise_result_;
 };
 
+// No remote test because LTH remote runs its own swap promises, and we
+// don't send swap promises to the LTH in process on the client side.
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromise);
 
 class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest {
@@ -4981,6 +4937,8 @@
   TestSwapPromiseResult swap_promise_result_;
 };
 
+// No remote test because LTH remote runs its own swap promises, and we
+// don't send swap promises to the LTH in process on the client side.
 MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromiseMFBA);
 
 class LayerTreeHostTestBreakSwapPromiseForVisibility
@@ -5023,6 +4981,8 @@
   TestSwapPromiseResult swap_promise_result_;
 };
 
+// No remote test because LTH remote runs its own swap promises, and we
+// don't send swap promises to the LTH in process on the client side.
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForVisibility);
 
 class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
@@ -5106,6 +5066,8 @@
   void AfterTest() override {}
 };
 
+// No remote test because LTH remote runs its own swap promises, and we
+// don't send swap promises to the LTH in process on the client side.
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
 
 class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
@@ -5327,6 +5289,8 @@
   FakeRecordingSource* recording_source_;
 };
 
+// No remote test since we does not send gpu rasterization flag to the client.
+// See crbug/650431.
 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled);
 
 class LayerTreeHostTestGpuRasterizationReenabled : public LayerTreeHostTest {