OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 &MonitoredVideoStubTest::OnVideoChannelStatus, | 36 &MonitoredVideoStubTest::OnVideoChannelStatus, |
37 base::Unretained(this)))); | 37 base::Unretained(this)))); |
38 EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _)).Times(AnyNumber()); | 38 EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _)).Times(AnyNumber()); |
39 } | 39 } |
40 | 40 |
41 MOCK_METHOD1(OnVideoChannelStatus, void(bool connected)); | 41 MOCK_METHOD1(OnVideoChannelStatus, void(bool connected)); |
42 | 42 |
43 base::MessageLoop message_loop_; | 43 base::MessageLoop message_loop_; |
44 MockVideoStub video_stub_; | 44 MockVideoStub video_stub_; |
45 | 45 |
46 scoped_ptr<MonitoredVideoStub> monitor_; | 46 std::unique_ptr<MonitoredVideoStub> monitor_; |
47 scoped_ptr<VideoPacket> packet_; | 47 std::unique_ptr<VideoPacket> packet_; |
48 base::OneShotTimer timer_end_test_; | 48 base::OneShotTimer timer_end_test_; |
49 }; | 49 }; |
50 | 50 |
51 TEST_F(MonitoredVideoStubTest, OnChannelConnected) { | 51 TEST_F(MonitoredVideoStubTest, OnChannelConnected) { |
52 EXPECT_CALL(*this, OnVideoChannelStatus(true)); | 52 EXPECT_CALL(*this, OnVideoChannelStatus(true)); |
53 // On slow machines, the connectivity check timer may fire before the test | 53 // On slow machines, the connectivity check timer may fire before the test |
54 // finishes, so we expect to see at most one transition to not ready. | 54 // finishes, so we expect to see at most one transition to not ready. |
55 EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1)); | 55 EXPECT_CALL(*this, OnVideoChannelStatus(false)).Times(AtMost(1)); |
56 | 56 |
57 monitor_->ProcessVideoPacket(std::move(packet_), base::Closure()); | 57 monitor_->ProcessVideoPacket(std::move(packet_), base::Closure()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 message_loop_.PostDelayedTask( | 91 message_loop_.PostDelayedTask( |
92 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), | 92 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
93 // The delay should be much greater than |kTestOverrideDelayMilliseconds|. | 93 // The delay should be much greater than |kTestOverrideDelayMilliseconds|. |
94 TestTimeouts::tiny_timeout()); | 94 TestTimeouts::tiny_timeout()); |
95 message_loop_.Run(); | 95 message_loop_.Run(); |
96 } | 96 } |
97 | 97 |
98 } // namespace protocol | 98 } // namespace protocol |
99 } // namespace remoting | 99 } // namespace remoting |
OLD | NEW |