Commit 0c193dc5 authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

cc: Fix failing layer tree tests

LayerTreeHostContextTestLayersNotified was changed recently to attach
root layer after first activation, but it does a static_cast on impl
layers before the layers are propagated to impl tree.

Bug: 903931
Change-Id: I824a5fe5f9915156090098f7c8b2306c32a9db23
Reviewed-on: https://chromium-review.googlesource.com/c/1330722
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607070}
parent d9c25cbb
...@@ -829,18 +829,21 @@ class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest { ...@@ -829,18 +829,21 @@ class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest {
void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl); LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl);
++num_commits_;
FakePictureLayerImpl* root_picture = nullptr; FakePictureLayerImpl* root_picture = nullptr;
FakePictureLayerImpl* child_picture = nullptr; FakePictureLayerImpl* child_picture = nullptr;
FakePictureLayerImpl* grandchild_picture = nullptr; FakePictureLayerImpl* grandchild_picture = nullptr;
// Root layer isn't attached on first activation so the static_cast will
root_picture = static_cast<FakePictureLayerImpl*>( // fail before second activation.
host_impl->active_tree()->root_layer_for_testing()); if (num_commits_ >= 2) {
child_picture = static_cast<FakePictureLayerImpl*>( root_picture = static_cast<FakePictureLayerImpl*>(
host_impl->active_tree()->LayerById(child_->id())); host_impl->active_tree()->root_layer_for_testing());
grandchild_picture = static_cast<FakePictureLayerImpl*>( child_picture = static_cast<FakePictureLayerImpl*>(
host_impl->active_tree()->LayerById(grandchild_->id())); host_impl->active_tree()->LayerById(child_->id()));
grandchild_picture = static_cast<FakePictureLayerImpl*>(
++num_commits_; host_impl->active_tree()->LayerById(grandchild_->id()));
}
switch (num_commits_) { switch (num_commits_) {
case 1: case 1:
// Because setting the colorspace on the first activation releases // Because setting the colorspace on the first activation releases
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment