Index: cc/test/layer_tree_test.cc |
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc |
index 3c6ff57baeaebe5bf0f899ffd2557d842c06d77a..56ef2c1a2197df72998b8d460e7b16c14f7bf698 100644 |
--- a/cc/test/layer_tree_test.cc |
+++ b/cc/test/layer_tree_test.cc |
@@ -878,4 +878,13 @@ void LayerTreeTest::DestroyLayerTreeHost() { |
layer_tree_host_ = nullptr; |
} |
+LayerTreeHost* LayerTreeTest::layer_tree_host() { |
+ // We check for a null proxy here as we sometimes ask for the layer tree host |
+ // when the proxy does not exist, often for checking settings after a test has |
+ // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
+ // elsewhere in this file for other examples. |
+ DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
+ return layer_tree_host_.get(); |
+} |
+ |
} // namespace cc |