OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/test/null_task_runner.h" | 9 #include "base/test/null_task_runner.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 bool damaged; | 90 bool damaged; |
91 bool display_resized_; | 91 bool display_resized_; |
92 bool has_new_root_surface; | 92 bool has_new_root_surface; |
93 bool swapped; | 93 bool swapped; |
94 }; | 94 }; |
95 | 95 |
96 class DisplayTest : public testing::Test { | 96 class DisplayTest : public testing::Test { |
97 public: | 97 public: |
98 DisplayTest() | 98 DisplayTest() |
99 : factory_(&manager_, &surface_factory_client_), | 99 : factory_(kArbitraryClientId, &manager_, &surface_factory_client_), |
100 id_allocator_(kArbitraryClientId), | 100 id_allocator_(kArbitraryClientId), |
101 task_runner_(new base::NullTaskRunner) { | 101 task_runner_(new base::NullTaskRunner) {} |
102 id_allocator_.RegisterSurfaceClientId(&manager_); | |
103 } | |
104 | 102 |
105 void SetUpDisplay(const RendererSettings& settings, | 103 void SetUpDisplay(const RendererSettings& settings, |
106 std::unique_ptr<TestWebGraphicsContext3D> context) { | 104 std::unique_ptr<TestWebGraphicsContext3D> context) { |
107 std::unique_ptr<BeginFrameSource> begin_frame_source( | 105 std::unique_ptr<BeginFrameSource> begin_frame_source( |
108 new StubBeginFrameSource); | 106 new StubBeginFrameSource); |
109 | 107 |
110 std::unique_ptr<FakeOutputSurface> output_surface; | 108 std::unique_ptr<FakeOutputSurface> output_surface; |
111 if (context) { | 109 if (context) { |
112 output_surface = FakeOutputSurface::Create3d(std::move(context)); | 110 output_surface = FakeOutputSurface::Create3d(std::move(context)); |
113 } else { | 111 } else { |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 485 |
488 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); | 486 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); |
489 display_->Resize(gfx::Size(250, 250)); | 487 display_->Resize(gfx::Size(250, 250)); |
490 testing::Mock::VerifyAndClearExpectations(context_ptr); | 488 testing::Mock::VerifyAndClearExpectations(context_ptr); |
491 | 489 |
492 factory_.Destroy(surface_id); | 490 factory_.Destroy(surface_id); |
493 } | 491 } |
494 | 492 |
495 } // namespace | 493 } // namespace |
496 } // namespace cc | 494 } // namespace cc |
OLD | NEW |