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

Side by Side Diff: remoting/protocol/monitored_video_stub_unittest.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/monitored_video_stub.h ('k') | remoting/protocol/performance_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/monitored_video_stub.h" 5 #include "remoting/protocol/monitored_video_stub.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "remoting/protocol/protocol_mock_objects.h" 10 #include "remoting/protocol/protocol_mock_objects.h"
(...skipping 23 matching lines...) Expand all
34 EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _)).Times(AnyNumber()); 34 EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _)).Times(AnyNumber());
35 } 35 }
36 36
37 MOCK_METHOD1(OnVideoChannelStatus, void(bool connected)); 37 MOCK_METHOD1(OnVideoChannelStatus, void(bool connected));
38 38
39 base::MessageLoop message_loop_; 39 base::MessageLoop message_loop_;
40 MockVideoStub video_stub_; 40 MockVideoStub video_stub_;
41 41
42 scoped_ptr<MonitoredVideoStub> monitor_; 42 scoped_ptr<MonitoredVideoStub> monitor_;
43 scoped_ptr<VideoPacket> packet_; 43 scoped_ptr<VideoPacket> packet_;
44 base::OneShotTimer<MonitoredVideoStubTest> timer_end_test_; 44 base::OneShotTimer timer_end_test_;
45 }; 45 };
46 46
47 TEST_F(MonitoredVideoStubTest, OnChannelConnected) { 47 TEST_F(MonitoredVideoStubTest, OnChannelConnected) {
48 EXPECT_CALL(*this, OnVideoChannelStatus(true)); 48 EXPECT_CALL(*this, OnVideoChannelStatus(true));
49 // On slow machines, the connectivity check timer may fire before the test 49 // On slow machines, the connectivity check timer may fire before the test
50 // finishes, so we expect to see at most one transition to not ready. 50 // finishes, so we expect to see at most one transition to not ready.
51 EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1)); 51 EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1));
52 52
53 monitor_->ProcessVideoPacket(packet_.Pass(), base::Closure()); 53 monitor_->ProcessVideoPacket(packet_.Pass(), base::Closure());
54 base::RunLoop().RunUntilIdle(); 54 base::RunLoop().RunUntilIdle();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 message_loop_.PostDelayedTask( 88 message_loop_.PostDelayedTask(
89 FROM_HERE, 89 FROM_HERE,
90 base::MessageLoop::QuitClosure(), 90 base::MessageLoop::QuitClosure(),
91 // The delay should be much greater than |kTestOverrideDelayMilliseconds|. 91 // The delay should be much greater than |kTestOverrideDelayMilliseconds|.
92 TestTimeouts::tiny_timeout()); 92 TestTimeouts::tiny_timeout());
93 message_loop_.Run(); 93 message_loop_.Run();
94 } 94 }
95 95
96 } // namespace protocol 96 } // namespace protocol
97 } // namespace remoting 97 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/monitored_video_stub.h ('k') | remoting/protocol/performance_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698