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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_(&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_); | 102 manager_.RegisterSurfaceClientId(id_allocator_.client_id()); |
| 103 } |
| 104 |
| 105 ~DisplayTest() override { |
| 106 manager_.InvalidateSurfaceClientId(id_allocator_.client_id()); |
103 } | 107 } |
104 | 108 |
105 void SetUpDisplay(const RendererSettings& settings, | 109 void SetUpDisplay(const RendererSettings& settings, |
106 std::unique_ptr<TestWebGraphicsContext3D> context) { | 110 std::unique_ptr<TestWebGraphicsContext3D> context) { |
107 std::unique_ptr<BeginFrameSource> begin_frame_source( | 111 std::unique_ptr<BeginFrameSource> begin_frame_source( |
108 new StubBeginFrameSource); | 112 new StubBeginFrameSource); |
109 | 113 |
110 std::unique_ptr<FakeOutputSurface> output_surface; | 114 std::unique_ptr<FakeOutputSurface> output_surface; |
111 if (context) { | 115 if (context) { |
112 output_surface = FakeOutputSurface::Create3d(std::move(context)); | 116 output_surface = FakeOutputSurface::Create3d(std::move(context)); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 491 |
488 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); | 492 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); |
489 display_->Resize(gfx::Size(250, 250)); | 493 display_->Resize(gfx::Size(250, 250)); |
490 testing::Mock::VerifyAndClearExpectations(context_ptr); | 494 testing::Mock::VerifyAndClearExpectations(context_ptr); |
491 | 495 |
492 factory_.Destroy(surface_id); | 496 factory_.Destroy(surface_id); |
493 } | 497 } |
494 | 498 |
495 } // namespace | 499 } // namespace |
496 } // namespace cc | 500 } // namespace cc |
OLD | NEW |