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

Unified Diff: remoting/test/cyclic_frame_generator.cc

Issue 2420183002: Don't use barcodes in ProtocolPerfTests (Closed)
Patch Set: Update ChromotingHost::OnSessionAuthenticated() to fix test crash Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/cyclic_frame_generator.h ('k') | remoting/test/frame_generator_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/cyclic_frame_generator.cc
diff --git a/remoting/test/cyclic_frame_generator.cc b/remoting/test/cyclic_frame_generator.cc
index 11c8bc57a2d8eb4d46983cb8c261a4d026713968..ef59810efc3f36ae947fa653cf5c37b76190e611 100644
--- a/remoting/test/cyclic_frame_generator.cc
+++ b/remoting/test/cyclic_frame_generator.cc
@@ -48,6 +48,7 @@ void CyclicFrameGenerator::SetTickClock(base::TickClock* tick_clock) {
std::unique_ptr<webrtc::DesktopFrame> CyclicFrameGenerator::GenerateFrame(
webrtc::SharedMemoryFactory* shared_memory_factory) {
base::TimeTicks now = clock_->NowTicks();
+
int frame_id = (now - started_time_) / cursor_blink_period_;
int reference_frame =
((now - started_time_) / frame_cycle_period_) % reference_frames_.size();
@@ -80,20 +81,15 @@ std::unique_ptr<webrtc::DesktopFrame> CyclicFrameGenerator::GenerateFrame(
last_frame_type_ = ChangeType::NO_CHANGES;
}
- if (draw_barcode_)
- DrawBarcode(frame_id, frame_id != last_frame_id_, frame.get());
-
last_reference_frame_ = reference_frame;
last_cursor_state_ = cursor_state;
- last_frame_id_ = frame_id;
return frame;
}
CyclicFrameGenerator::ChangeInfoList CyclicFrameGenerator::GetChangeList(
- webrtc::DesktopFrame* frame) {
- CHECK(draw_barcode_);
- int frame_id = ReadBarcode(*frame);
+ base::TimeTicks timestamp) {
+ int frame_id = (timestamp - started_time_) / cursor_blink_period_;
CHECK_GE(frame_id, last_identifier_frame_);
ChangeInfoList result;
@@ -110,5 +106,10 @@ CyclicFrameGenerator::ChangeInfoList CyclicFrameGenerator::GetChangeList(
return result;
}
+protocol::InputEventTimestamps CyclicFrameGenerator::TakeLastEventTimestamps() {
+ base::TimeTicks now = clock_->NowTicks();
+ return protocol::InputEventTimestamps{now, now};
+}
+
} // namespace test
} // namespace remoting
« no previous file with comments | « remoting/test/cyclic_frame_generator.h ('k') | remoting/test/frame_generator_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698