Commit 9fa354c9 authored by sergeyu's avatar sergeyu Committed by Commit bot

Fix VideoFramePump to send keep-alive packets only after the first real frame.

Many ClientSession unittests assume that the first video frame always
contains video dimensions. When running under valgrind the keep-alive timer
may fire before the first video frame is sent and this breaks the tests.

Fixed VideoFramePump to start sending keep-alive messages only after the
first real frame is sent. Also made the keep-alive timer non-repeating.
This ensures that the pump doesn't try sending a keep-alive message until
the previous one has been sent.

BUG=458691

Review URL: https://codereview.chromium.org/936553003

Cr-Commit-Position: refs/heads/master@{#316933}
parent 4761ff89
...@@ -384,7 +384,7 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) { ...@@ -384,7 +384,7 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) {
ConnectClientSession(); ConnectClientSession();
// With for the first frame. // Wait for the first frame.
run_loop.Run(); run_loop.Run();
// Inject test events that are expected to be injected. // Inject test events that are expected to be injected.
...@@ -445,8 +445,7 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) { ...@@ -445,8 +445,7 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) {
client_session_.reset(); client_session_.reset();
} }
// crbug.com/458691 TEST_F(ClientSessionTest, LocalInputTest) {
TEST_F(ClientSessionTest, DISABLED_LocalInputTest) {
CreateClientSession(); CreateClientSession();
protocol::MouseEvent mouse_event1; protocol::MouseEvent mouse_event1;
...@@ -502,8 +501,7 @@ TEST_F(ClientSessionTest, DISABLED_LocalInputTest) { ...@@ -502,8 +501,7 @@ TEST_F(ClientSessionTest, DISABLED_LocalInputTest) {
ConnectClientSession(); ConnectClientSession();
} }
// crbug.com/458691 TEST_F(ClientSessionTest, RestoreEventState) {
TEST_F(ClientSessionTest, DISABLED_RestoreEventState) {
CreateClientSession(); CreateClientSession();
protocol::KeyEvent key1; protocol::KeyEvent key1;
...@@ -559,8 +557,7 @@ TEST_F(ClientSessionTest, DISABLED_RestoreEventState) { ...@@ -559,8 +557,7 @@ TEST_F(ClientSessionTest, DISABLED_RestoreEventState) {
ConnectClientSession(); ConnectClientSession();
} }
// crbug.com/458691 TEST_F(ClientSessionTest, ClampMouseEvents) {
TEST_F(ClientSessionTest, DISABLED_ClampMouseEvents) {
CreateClientSession(); CreateClientSession();
Expectation authenticated = Expectation authenticated =
......
...@@ -60,7 +60,12 @@ VideoFramePump::VideoFramePump( ...@@ -60,7 +60,12 @@ VideoFramePump::VideoFramePump(
capturer_(capturer.Pass()), capturer_(capturer.Pass()),
encoder_(encoder.Pass()), encoder_(encoder.Pass()),
video_stub_(video_stub), video_stub_(video_stub),
keep_alive_timer_(true, true), keep_alive_timer_(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kKeepAlivePacketIntervalMs),
base::Bind(&VideoFramePump::SendKeepAlivePacket,
base::Unretained(this)),
false),
capture_scheduler_(base::Bind(&VideoFramePump::CaptureNextFrame, capture_scheduler_(base::Bind(&VideoFramePump::CaptureNextFrame,
base::Unretained(this))), base::Unretained(this))),
latest_event_timestamp_(0), latest_event_timestamp_(0),
...@@ -70,10 +75,6 @@ VideoFramePump::VideoFramePump( ...@@ -70,10 +75,6 @@ VideoFramePump::VideoFramePump(
capturer_->Start(this); capturer_->Start(this);
capture_scheduler_.Start(); capture_scheduler_.Start();
keep_alive_timer_.Start(
FROM_HERE, base::TimeDelta::FromMilliseconds(kKeepAlivePacketIntervalMs),
base::Bind(&VideoFramePump::SendKeepAlivePacket, base::Unretained(this)));
} }
VideoFramePump::~VideoFramePump() { VideoFramePump::~VideoFramePump() {
......
# http://crbug.com/241856 # http://crbug.com/241856
VideoSchedulerTest.StartAndStop VideoSchedulerTest.StartAndStop
# crbug.com/458691
ClientSessionTest.ClipboardStubFilter
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment