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

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

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

Powered by Google App Engine
This is Rietveld 408576698