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 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6183 | 6183 |
6184 ScrollAndScaleSet scroll_info_; | 6184 ScrollAndScaleSet scroll_info_; |
6185 ScrollAndScaleSet scale_info_; | 6185 ScrollAndScaleSet scale_info_; |
6186 ScrollAndScaleSet no_op_info_; | 6186 ScrollAndScaleSet no_op_info_; |
6187 bool requested_update_layers_; | 6187 bool requested_update_layers_; |
6188 int commit_count_; | 6188 int commit_count_; |
6189 }; | 6189 }; |
6190 | 6190 |
6191 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers); | 6191 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers); |
6192 | 6192 |
| 6193 class LayerTreeHostTestDestroyWhileInitializingOutputSurface |
| 6194 : public LayerTreeHostTest { |
| 6195 protected: |
| 6196 void BeginTest() override { |
| 6197 // By ending the test immediately we start initialization of an output |
| 6198 // surface but destroy the LTH before it completes. This test verifies |
| 6199 // that this works correctly and the output surface is destroyed on |
| 6200 // the correct thread. |
| 6201 EndTest(); |
| 6202 } |
| 6203 |
| 6204 void AfterTest() override {} |
| 6205 }; |
| 6206 |
| 6207 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); |
| 6208 |
6193 } // namespace | 6209 } // namespace |
6194 } // namespace cc | 6210 } // namespace cc |
OLD | NEW |