Chromium Code Reviews| Index: remoting/protocol/monitored_video_stub_unittest.cc |
| diff --git a/remoting/protocol/monitored_video_stub_unittest.cc b/remoting/protocol/monitored_video_stub_unittest.cc |
| index 74f26aa23f381eae1ce5d0e76a1d8812db39dd2c..40587e56b457305ff29a9f8ca2c5c9d8e9452791 100644 |
| --- a/remoting/protocol/monitored_video_stub_unittest.cc |
| +++ b/remoting/protocol/monitored_video_stub_unittest.cc |
| @@ -14,6 +14,7 @@ |
| using ::testing::_; |
| using ::testing::AnyNumber; |
| +using ::testing::AtMost; |
| using ::testing::InvokeWithoutArgs; |
| namespace remoting { |
| @@ -46,6 +47,10 @@ class MonitoredVideoStubTest : public testing::Test { |
| TEST_F(MonitoredVideoStubTest, OnChannelConnected) { |
| EXPECT_CALL(*this, OnVideoChannelStatus(true)); |
| + // On slow machines, the connectivity check timer may fires before the test |
|
Jamie
2014/05/02 01:06:32
s/fires/fire/, here and below.
kelvinp
2014/05/02 01:11:14
Done.
|
| + // finishes, so we expect to see at most one transition to not ready. |
| + EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1)); |
| + |
| monitor_->ProcessVideoPacket(packet_.Pass(), base::Closure()); |
| base::RunLoop().RunUntilIdle(); |
| } |
| @@ -64,7 +69,10 @@ TEST_F(MonitoredVideoStubTest, OnChannelDisconnected) { |
| TEST_F(MonitoredVideoStubTest, OnChannelStayConnected) { |
| // Verify no extra connected events are fired when packets are received |
| // frequently |
| - EXPECT_CALL(*this, OnVideoChannelStatus(_)).Times(1); |
| + EXPECT_CALL(*this, OnVideoChannelStatus(true)); |
| + // On slow machines, the connectivity check timer may fires before the test |
| + // finishes, so we expect to see at most one transition to not ready. |
| + EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1)); |
| monitor_->ProcessVideoPacket(packet_.Pass(), base::Closure()); |
| monitor_->ProcessVideoPacket(packet_.Pass(), base::Closure()); |