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

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: android build fix 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
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 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698