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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698