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

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: Addressed Kevin's comments 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
« blimp/net/packet_writer.h ('K') | « 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
Kevin M 2016/05/20 01:02:04 I know the previous code was written this way, but
vmpstr 2016/05/20 23:26:14 (here and in the above lines please. increment in
shaktisahu 2016/05/22 22:36:58 Done.
shaktisahu 2016/05/22 22:36:58 Done.
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
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
OLDNEW
« blimp/net/packet_writer.h ('K') | « cc/trees/remote_channel_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698