| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 458 } |
| 459 | 459 |
| 460 private: | 460 private: |
| 461 class MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface | 461 class MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface |
| 462 : public FakeOutputSurface { | 462 : public FakeOutputSurface { |
| 463 public: | 463 public: |
| 464 ~MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface() {} | 464 ~MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface() {} |
| 465 explicit MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface( | 465 explicit MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface( |
| 466 bool delegated_rendering) | 466 bool delegated_rendering) |
| 467 : FakeOutputSurface(TestContextProvider::Create(), | 467 : FakeOutputSurface(TestContextProvider::Create(), |
| 468 TestContextProvider::Create(), | 468 TestContextProvider::CreateWorker(), |
| 469 delegated_rendering) {} | 469 delegated_rendering) {} |
| 470 MOCK_METHOD1(SetWorkerContextShouldAggressivelyFreeResources, | 470 MOCK_METHOD1(SetWorkerContextShouldAggressivelyFreeResources, |
| 471 void(bool is_visible)); | 471 void(bool is_visible)); |
| 472 }; | 472 }; |
| 473 }; | 473 }; |
| 474 | 474 |
| 475 // Test if the LTH successfully frees resources on the worker context when | 475 // Test if the LTH successfully frees resources on the worker context when |
| 476 // visibility is set to false. | 476 // visibility is set to false. |
| 477 class LayerTreeHostFreeWorkerContextResourcesOnInvisible | 477 class LayerTreeHostFreeWorkerContextResourcesOnInvisible |
| 478 : public LayerTreeHostFreeWorkerContextResourcesTest { | 478 : public LayerTreeHostFreeWorkerContextResourcesTest { |
| (...skipping 5772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6251 | 6251 |
| 6252 ScrollAndScaleSet scroll_info_; | 6252 ScrollAndScaleSet scroll_info_; |
| 6253 ScrollAndScaleSet scale_info_; | 6253 ScrollAndScaleSet scale_info_; |
| 6254 ScrollAndScaleSet no_op_info_; | 6254 ScrollAndScaleSet no_op_info_; |
| 6255 bool requested_update_layers_; | 6255 bool requested_update_layers_; |
| 6256 int commit_count_; | 6256 int commit_count_; |
| 6257 }; | 6257 }; |
| 6258 | 6258 |
| 6259 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers); | 6259 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers); |
| 6260 | 6260 |
| 6261 class LayerTreeHostTestDestroyWhileInitializingOutputSurface |
| 6262 : public LayerTreeHostTest { |
| 6263 protected: |
| 6264 void BeginTest() override { |
| 6265 // By ending the test immediately we start initialization of an output |
| 6266 // surface but destroy the LTH before it completes. This test verifies |
| 6267 // that this works correctly and the output surface is destroyed on |
| 6268 // the correct thread. |
| 6269 EndTest(); |
| 6270 } |
| 6271 |
| 6272 void AfterTest() override {} |
| 6273 }; |
| 6274 |
| 6275 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); |
| 6276 |
| 6261 } // namespace | 6277 } // namespace |
| 6262 } // namespace cc | 6278 } // namespace cc |
| OLD | NEW |