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

Unified Diff: remoting/protocol/connection_unittest.cc

Issue 2413553003: Add InputEventTimestampSource interface. (Closed)
Patch Set: address feedback 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
Index: remoting/protocol/connection_unittest.cc
diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc
index 03ee5e35694e46be68aadc65ef3ddb955b9fd134..77b6306f7a031489b06bc146ffc2050edd01dafd 100644
--- a/remoting/protocol/connection_unittest.cc
+++ b/remoting/protocol/connection_unittest.cc
@@ -470,7 +470,6 @@ TEST_P(ConnectionTest, Events) {
base::RunLoop run_loop;
- EXPECT_CALL(host_event_handler_, OnInputEventReceived(_));
EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(event)))
.WillOnce(QuitRunLoop(&run_loop));
@@ -515,7 +514,6 @@ TEST_P(ConnectionTest, DestroyOnIncomingMessage) {
base::RunLoop run_loop;
- EXPECT_CALL(host_event_handler_, OnInputEventReceived(_));
EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(event)))
.WillOnce(DoAll(InvokeWithoutArgs(this, &ConnectionTest::DestroyHost),
QuitRunLoop(&run_loop)));
@@ -537,12 +535,15 @@ TEST_P(ConnectionTest, VideoStats) {
base::TimeTicks start_time = base::TimeTicks::Now();
+ scoped_refptr<InputEventTimestampsSourceImpl> input_event_timestamps_source =
+ new InputEventTimestampsSourceImpl();
+ input_event_timestamps_source->OnEventReceived(InputEventTimestamps{
+ .client_timestamp = start_time, .host_timestamp = start_time});
+
std::unique_ptr<VideoStream> video_stream =
host_connection_->StartVideoStream(
base::MakeUnique<TestScreenCapturer>());
-
- // Simulate an input invent injected at the start.
- video_stream->OnInputEventReceived(start_time.ToInternalValue());
+ video_stream->SetEventTimestampsSource(input_event_timestamps_source);
WaitFirstVideoFrame();

Powered by Google App Engine
This is Rietveld 408576698