| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/begin_frame_args_test.h" | 5 #include "cc/test/begin_frame_args_test.h" |
| 6 #include "cc/test/layer_tree_test.h" | 6 #include "cc/test/layer_tree_test.h" |
| 7 | 7 |
| 8 namespace cc { | 8 namespace cc { |
| 9 | 9 |
| 10 class RemoteChannelTest : public LayerTreeTest { | 10 class RemoteChannelTest : public LayerTreeTest { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 layer_tree_host()->SetViewportSize(viewport_size_); | 136 layer_tree_host()->SetViewportSize(viewport_size_); |
| 137 PostSetNeedsCommitToMainThread(); | 137 PostSetNeedsCommitToMainThread(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SetNeedsCommitOnImpl() override { EXPECT_EQ(0, calls_received_++); } | 140 void SetNeedsCommitOnImpl() override { EXPECT_EQ(0, calls_received_++); } |
| 141 | 141 |
| 142 void ReceivedBeginMainFrame() override { EXPECT_EQ(1, calls_received_++); } | 142 void ReceivedBeginMainFrame() override { EXPECT_EQ(1, calls_received_++); } |
| 143 | 143 |
| 144 void StartCommitOnImpl() override { EXPECT_EQ(2, calls_received_++); } | 144 void StartCommitOnImpl() override { EXPECT_EQ(2, calls_received_++); } |
| 145 | 145 |
| 146 void DidCommitAndDrawFrame() override { EXPECT_EQ(3, calls_received_++); } | 146 void DidCommitAndDrawFrame() override { |
| 147 calls_received_on_both_server_and_client_++; |
| 148 } |
| 147 | 149 |
| 148 void DidCompleteSwapBuffers() override { | 150 void DidCompleteSwapBuffers() override { |
| 149 if (++calls_received_on_both_server_and_client_ == 2) | 151 if (++calls_received_on_both_server_and_client_ == 4) |
| 150 EndTest(); | 152 EndTest(); |
| 151 } | 153 } |
| 152 | 154 |
| 153 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 155 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 154 // Ensure that we serialized and deserialized the LayerTreeHost for the | 156 // Ensure that we serialized and deserialized the LayerTreeHost for the |
| 155 // commit. | 157 // commit. |
| 156 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); | 158 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); |
| 157 } | 159 } |
| 158 | 160 |
| 159 void AfterTest() override { | 161 void AfterTest() override { |
| 160 EXPECT_EQ(4, calls_received_); | 162 EXPECT_EQ(3, calls_received_); |
| 161 EXPECT_EQ(2, calls_received_on_both_server_and_client_); | 163 EXPECT_EQ(4, calls_received_on_both_server_and_client_); |
| 162 } | 164 } |
| 163 | 165 |
| 164 const gfx::Size viewport_size_ = gfx::Size(5, 3); | 166 const gfx::Size viewport_size_ = gfx::Size(5, 3); |
| 165 }; | 167 }; |
| 166 | 168 |
| 167 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit); | 169 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit); |
| 168 | 170 |
| 169 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest { | 171 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest { |
| 170 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); } | 172 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); } |
| 171 | 173 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 226 } |
| 225 | 227 |
| 226 int output_surface_initialized_count_; | 228 int output_surface_initialized_count_; |
| 227 int commit_count_; | 229 int commit_count_; |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 REMOTE_DIRECT_RENDERER_TEST_F( | 232 REMOTE_DIRECT_RENDERER_TEST_F( |
| 231 RemoteChannelTestReleaseOutputSurfaceDuringCommit); | 233 RemoteChannelTestReleaseOutputSurfaceDuringCommit); |
| 232 | 234 |
| 233 } // namespace cc | 235 } // namespace cc |
| OLD | NEW |