OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/compositor_frame_sink.h" | 5 #include "cc/output/compositor_frame_sink.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/test/fake_compositor_frame_sink_client.h" | 9 #include "cc/test/fake_compositor_frame_sink_client.h" |
10 #include "cc/test/test_context_provider.h" | 10 #include "cc/test/test_context_provider.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 scoped_refptr<TestContextProvider> context_provider, | 21 scoped_refptr<TestContextProvider> context_provider, |
22 scoped_refptr<TestContextProvider> worker_context_provider) | 22 scoped_refptr<TestContextProvider> worker_context_provider) |
23 : CompositorFrameSink(std::move(context_provider), | 23 : CompositorFrameSink(std::move(context_provider), |
24 std::move(worker_context_provider), | 24 std::move(worker_context_provider), |
25 nullptr, | 25 nullptr, |
26 nullptr) {} | 26 nullptr) {} |
27 | 27 |
28 void SubmitCompositorFrame(CompositorFrame frame) override { | 28 void SubmitCompositorFrame(CompositorFrame frame) override { |
29 client_->DidReceiveCompositorFrameAck(); | 29 client_->DidReceiveCompositorFrameAck(); |
30 } | 30 } |
| 31 void BeginFrameDidNotProduceFrame(const BeginFrameAck& ack) override {} |
31 }; | 32 }; |
32 | 33 |
33 TEST(CompositorFrameSinkTest, ContextLossInformsClient) { | 34 TEST(CompositorFrameSinkTest, ContextLossInformsClient) { |
34 scoped_refptr<TestContextProvider> provider = TestContextProvider::Create(); | 35 scoped_refptr<TestContextProvider> provider = TestContextProvider::Create(); |
35 scoped_refptr<TestContextProvider> worker_provider = | 36 scoped_refptr<TestContextProvider> worker_provider = |
36 TestContextProvider::CreateWorker(); | 37 TestContextProvider::CreateWorker(); |
37 TestCompositorFrameSink compositor_frame_sink(provider, worker_provider); | 38 TestCompositorFrameSink compositor_frame_sink(provider, worker_provider); |
38 EXPECT_FALSE(compositor_frame_sink.HasClient()); | 39 EXPECT_FALSE(compositor_frame_sink.HasClient()); |
39 | 40 |
40 FakeCompositorFrameSinkClient client; | 41 FakeCompositorFrameSinkClient client; |
(...skipping 23 matching lines...) Expand all Loading... |
64 worker_provider); | 65 worker_provider); |
65 EXPECT_FALSE(compositor_frame_sink.HasClient()); | 66 EXPECT_FALSE(compositor_frame_sink.HasClient()); |
66 | 67 |
67 FakeCompositorFrameSinkClient client; | 68 FakeCompositorFrameSinkClient client; |
68 EXPECT_FALSE(compositor_frame_sink.BindToClient(&client)); | 69 EXPECT_FALSE(compositor_frame_sink.BindToClient(&client)); |
69 EXPECT_FALSE(compositor_frame_sink.HasClient()); | 70 EXPECT_FALSE(compositor_frame_sink.HasClient()); |
70 } | 71 } |
71 | 72 |
72 } // namespace | 73 } // namespace |
73 } // namespace cc | 74 } // namespace cc |
OLD | NEW |