| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 EXPECT_EQ(4, calls_received_++); | 143 EXPECT_EQ(4, calls_received_++); |
| 144 EndTest(); | 144 EndTest(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 147 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 148 // Ensure that we serialized and deserialized the LayerTreeHost for the | 148 // Ensure that we serialized and deserialized the LayerTreeHost for the |
| 149 // commit. | 149 // commit. |
| 150 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); | 150 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void ScheduledActionSendBeginMainFrame() override { | |
| 154 last_args_sent_ = GetProxyImplForTest()->last_begin_frame_args(); | |
| 155 } | |
| 156 | |
| 157 void BeginMainFrame(const BeginFrameArgs& args) override { | |
| 158 last_args_received_ = args; | |
| 159 } | |
| 160 | |
| 161 void AfterTest() override { | 153 void AfterTest() override { |
| 162 EXPECT_EQ(5, calls_received_); | 154 EXPECT_EQ(5, calls_received_); |
| 163 | |
| 164 // Ensure that we serialized and deserialized the | |
| 165 // BeginMainFrameAndCommitState. While the last_args_received_ will be set | |
| 166 // on the impl thread, it is safe to read it here since the impl thread has | |
| 167 // been destroyed now. | |
| 168 EXPECT_EQ(last_args_sent_, last_args_received_); | |
| 169 } | 155 } |
| 170 | 156 |
| 171 const gfx::Size viewport_size_ = gfx::Size(5, 3); | 157 const gfx::Size viewport_size_ = gfx::Size(5, 3); |
| 172 BeginFrameArgs last_args_sent_; | |
| 173 BeginFrameArgs last_args_received_; | |
| 174 }; | 158 }; |
| 175 | 159 |
| 176 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit); | 160 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit); |
| 177 | 161 |
| 178 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest { | 162 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest { |
| 179 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); } | 163 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); } |
| 180 | 164 |
| 181 void ScheduledActionWillSendBeginMainFrame() override { | 165 void ScheduledActionWillSendBeginMainFrame() override { |
| 182 PostSetDeferCommitsToMainThread(true); | 166 PostSetDeferCommitsToMainThread(true); |
| 183 } | 167 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 217 } |
| 234 | 218 |
| 235 int output_surface_initialized_count_; | 219 int output_surface_initialized_count_; |
| 236 int commit_count_; | 220 int commit_count_; |
| 237 }; | 221 }; |
| 238 | 222 |
| 239 REMOTE_DIRECT_RENDERER_TEST_F( | 223 REMOTE_DIRECT_RENDERER_TEST_F( |
| 240 RemoteChannelTestReleaseOutputSurfaceDuringCommit); | 224 RemoteChannelTestReleaseOutputSurfaceDuringCommit); |
| 241 | 225 |
| 242 } // namespace cc | 226 } // namespace cc |
| OLD | NEW |