Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: cc/trees/remote_channel_unittest.cc

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added empty implementation for linux client Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/remote_channel_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }; 130 };
131 131
132 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestReleaseOutputSurface); 132 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestReleaseOutputSurface);
133 133
134 class RemoteChannelTestCommit : public RemoteChannelTest { 134 class RemoteChannelTestCommit : public RemoteChannelTest {
135 void BeginChannelTest() override { 135 void BeginChannelTest() override {
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 {
141 calls_received_++;
142 EXPECT_EQ(1, calls_received_);
143 }
141 144
142 void ReceivedBeginMainFrame() override { EXPECT_EQ(1, calls_received_++); } 145 void ReceivedBeginMainFrame() override {
146 calls_received_++;
147 EXPECT_EQ(2, calls_received_);
148 }
143 149
144 void StartCommitOnImpl() override { EXPECT_EQ(2, calls_received_++); } 150 void StartCommitOnImpl() override {
151 calls_received_++;
152 EXPECT_EQ(3, calls_received_);
153 }
145 154
146 void DidCommitAndDrawFrame() override { EXPECT_EQ(3, calls_received_++); } 155 void DidCommitAndDrawFrame() override {
156 calls_received_on_both_server_and_client_++;
157 }
147 158
148 void DidCompleteSwapBuffers() override { 159 void DidCompleteSwapBuffers() override {
149 if (++calls_received_on_both_server_and_client_ == 2) 160 calls_received_on_both_server_and_client_++;
161 if (calls_received_on_both_server_and_client_ == 4)
150 EndTest(); 162 EndTest();
151 } 163 }
152 164
153 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 165 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
154 // Ensure that we serialized and deserialized the LayerTreeHost for the 166 // Ensure that we serialized and deserialized the LayerTreeHost for the
155 // commit. 167 // commit.
156 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); 168 EXPECT_EQ(viewport_size_, host_impl->device_viewport_size());
157 } 169 }
158 170
159 void AfterTest() override { 171 void AfterTest() override {
160 EXPECT_EQ(4, calls_received_); 172 EXPECT_EQ(3, calls_received_);
161 EXPECT_EQ(2, calls_received_on_both_server_and_client_); 173 EXPECT_EQ(4, calls_received_on_both_server_and_client_);
162 } 174 }
163 175
164 const gfx::Size viewport_size_ = gfx::Size(5, 3); 176 const gfx::Size viewport_size_ = gfx::Size(5, 3);
165 }; 177 };
166 178
167 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit); 179 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit);
168 180
169 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest { 181 class RemoteChannelTestBeginMainFrameAborted : public RemoteChannelTest {
170 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); } 182 void BeginChannelTest() override { PostSetNeedsCommitToMainThread(); }
171 183
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 236 }
225 237
226 int output_surface_initialized_count_; 238 int output_surface_initialized_count_;
227 int commit_count_; 239 int commit_count_;
228 }; 240 };
229 241
230 REMOTE_DIRECT_RENDERER_TEST_F( 242 REMOTE_DIRECT_RENDERER_TEST_F(
231 RemoteChannelTestReleaseOutputSurfaceDuringCommit); 243 RemoteChannelTestReleaseOutputSurfaceDuringCommit);
232 244
233 } // namespace cc 245 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/remote_channel_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698