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

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: remove bad ChildProcess::current() call 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 457 }
458 458
459 private: 459 private:
460 class MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface 460 class MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface
461 : public FakeOutputSurface { 461 : public FakeOutputSurface {
462 public: 462 public:
463 ~MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface() {} 463 ~MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface() {}
464 explicit MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface( 464 explicit MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface(
465 bool delegated_rendering) 465 bool delegated_rendering)
466 : FakeOutputSurface(TestContextProvider::Create(), 466 : FakeOutputSurface(TestContextProvider::Create(),
467 TestContextProvider::Create(), 467 TestContextProvider::CreateWorker(),
468 delegated_rendering) {} 468 delegated_rendering) {}
469 MOCK_METHOD1(SetWorkerContextShouldAggressivelyFreeResources, 469 MOCK_METHOD1(SetWorkerContextShouldAggressivelyFreeResources,
470 void(bool is_visible)); 470 void(bool is_visible));
471 }; 471 };
472 }; 472 };
473 473
474 // Test if the LTH successfully frees resources on the worker context when 474 // Test if the LTH successfully frees resources on the worker context when
475 // visibility is set to false. 475 // visibility is set to false.
476 class LayerTreeHostFreeWorkerContextResourcesOnInvisible 476 class LayerTreeHostFreeWorkerContextResourcesOnInvisible
477 : public LayerTreeHostFreeWorkerContextResourcesTest { 477 : public LayerTreeHostFreeWorkerContextResourcesTest {
(...skipping 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after
6182 6182
6183 ScrollAndScaleSet scroll_info_; 6183 ScrollAndScaleSet scroll_info_;
6184 ScrollAndScaleSet scale_info_; 6184 ScrollAndScaleSet scale_info_;
6185 ScrollAndScaleSet no_op_info_; 6185 ScrollAndScaleSet no_op_info_;
6186 bool requested_update_layers_; 6186 bool requested_update_layers_;
6187 int commit_count_; 6187 int commit_count_;
6188 }; 6188 };
6189 6189
6190 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers); 6190 MULTI_THREAD_TEST_F(LayerTreeHostScrollingAndScalingUpdatesLayers);
6191 6191
6192 class LayerTreeHostTestDestroyWhileInitializingOutputSurface
6193 : public LayerTreeHostTest {
6194 protected:
6195 void BeginTest() override {
6196 // By ending the test immediately we start initialization of an output
6197 // surface but destroy the LTH before it completes. This test verifies
6198 // that this works correctly and the output surface is destroyed on
6199 // the correct thread.
6200 EndTest();
6201 }
6202
6203 void AfterTest() override {}
6204 };
6205
6206 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
6207
6192 } // namespace 6208 } // namespace
6193 } // namespace cc 6209 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698