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

Unified Diff: remoting/protocol/monitored_video_stub_unittest.cc

Issue 264963007: Fix MonitoredVideoStubTest failure in memory runs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix MonitoredVideoStubTest failure in memory runs Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/remoting_unittests.gtest.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/remoting_unittests.gtest.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698