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

Unified Diff: cc/test/push_properties_counting_layer_impl.cc

Issue 2456093003: Enable more layer_tree_host_unittest for LayerTreeHostRemote. (Closed)
Patch Set: Minor polish on refactored test class. Created 4 years, 1 month 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/push_properties_counting_layer_impl.h ('k') | cc/test/remote_client_layer_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/push_properties_counting_layer_impl.cc
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 0000000000000000000000000000000000000000..523317081263c31af0358f5c19ab073f091ac0e9
--- /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
« no previous file with comments | « cc/test/push_properties_counting_layer_impl.h ('k') | cc/test/remote_client_layer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698