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

Side by Side Diff: remoting/client/software_video_renderer_unittest.cc

Issue 1846893002: Interface with webrtc through encoded frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address unit test failures due to race Created 4 years, 8 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 | « no previous file | remoting/codec/codec_test.cc » ('j') | remoting/protocol/webrtc_video_encoder.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // std::vector<bool> doesn't allow to get pointer to individual values, so 160 // std::vector<bool> doesn't allow to get pointer to individual values, so
161 // int needs to be used instead. 161 // int needs to be used instead.
162 std::vector<int> callback_called(kFrameCount); 162 std::vector<int> callback_called(kFrameCount);
163 163
164 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { 164 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) {
165 test_frames.push_back(CreateTestFrame(frame_index)); 165 test_frames.push_back(CreateTestFrame(frame_index));
166 callback_called[frame_index] = 0; 166 callback_called[frame_index] = 0;
167 167
168 renderer_->ProcessVideoPacket( 168 renderer_->ProcessVideoPacket(
169 encoder_.Encode(*test_frames[frame_index]), 169 encoder_.Encode(*test_frames[frame_index], 0),
170 base::Bind(&SetTrue, &(callback_called[frame_index]))); 170 base::Bind(&SetTrue, &(callback_called[frame_index])));
171 } 171 }
172 172
173 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { 173 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) {
174 base::Closure done_callback; 174 base::Closure done_callback;
175 std::unique_ptr<DesktopFrame> decoded_frame = 175 std::unique_ptr<DesktopFrame> decoded_frame =
176 frame_consumer_.WaitForNextFrame(&done_callback); 176 frame_consumer_.WaitForNextFrame(&done_callback);
177 177
178 EXPECT_FALSE(callback_called[frame_index]); 178 EXPECT_FALSE(callback_called[frame_index]);
179 done_callback.Run(); 179 done_callback.Run();
180 EXPECT_TRUE(callback_called[frame_index]); 180 EXPECT_TRUE(callback_called[frame_index]);
181 181
182 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); 182 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame));
183 } 183 }
184 } 184 }
185 185
186 } // namespace remoting 186 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/codec/codec_test.cc » ('j') | remoting/protocol/webrtc_video_encoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698