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

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

Issue 1322853005: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 8462 matching lines...) Expand 10 before | Expand all | Expand 10 after
8473 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, 8473 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED,
8474 host_impl_->gpu_rasterization_status()); 8474 host_impl_->gpu_rasterization_status());
8475 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); 8475 EXPECT_TRUE(host_impl_->use_gpu_rasterization());
8476 } 8476 }
8477 8477
8478 // A mock output surface which lets us detect calls to ForceReclaimResources. 8478 // A mock output surface which lets us detect calls to ForceReclaimResources.
8479 class MockReclaimResourcesOutputSurface : public FakeOutputSurface { 8479 class MockReclaimResourcesOutputSurface : public FakeOutputSurface {
8480 public: 8480 public:
8481 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() { 8481 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() {
8482 return make_scoped_ptr(new MockReclaimResourcesOutputSurface( 8482 return make_scoped_ptr(new MockReclaimResourcesOutputSurface(
8483 TestContextProvider::Create(), TestContextProvider::Create(), false)); 8483 TestContextProvider::Create(), TestContextProvider::CreateWorker(),
8484 false));
8484 } 8485 }
8485 8486
8486 MOCK_METHOD0(ForceReclaimResources, void()); 8487 MOCK_METHOD0(ForceReclaimResources, void());
8487 8488
8488 protected: 8489 protected:
8489 MockReclaimResourcesOutputSurface( 8490 MockReclaimResourcesOutputSurface(
8490 scoped_refptr<ContextProvider> context_provider, 8491 scoped_refptr<ContextProvider> context_provider,
8491 scoped_refptr<ContextProvider> worker_context_provider, 8492 scoped_refptr<ContextProvider> worker_context_provider,
8492 bool delegated_rendering) 8493 bool delegated_rendering)
8493 : FakeOutputSurface(context_provider, 8494 : FakeOutputSurface(context_provider,
(...skipping 11 matching lines...) Expand all
8505 // Hold an unowned pointer to the output surface to use for mock expectations. 8506 // Hold an unowned pointer to the output surface to use for mock expectations.
8506 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); 8507 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get();
8507 8508
8508 CreateHostImpl(DefaultSettings(), output_surface.Pass()); 8509 CreateHostImpl(DefaultSettings(), output_surface.Pass());
8509 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); 8510 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1);
8510 host_impl_->BeginCommit(); 8511 host_impl_->BeginCommit();
8511 } 8512 }
8512 8513
8513 } // namespace 8514 } // namespace
8514 } // namespace cc 8515 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698