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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 MediaStreamVideoTrackTest() | 31 MediaStreamVideoTrackTest() |
32 : child_process_(new ChildProcess()), | 32 : child_process_(new ChildProcess()), |
33 mock_source_(new MockMediaStreamVideoSource(false)), | 33 mock_source_(new MockMediaStreamVideoSource(false)), |
34 source_started_(false) { | 34 source_started_(false) { |
35 blink_source_.initialize(base::UTF8ToUTF16("dummy_source_id"), | 35 blink_source_.initialize(base::UTF8ToUTF16("dummy_source_id"), |
36 blink::WebMediaStreamSource::TypeVideo, | 36 blink::WebMediaStreamSource::TypeVideo, |
37 base::UTF8ToUTF16("dummy_source_name")); | 37 base::UTF8ToUTF16("dummy_source_name")); |
38 blink_source_.setExtraData(mock_source_); | 38 blink_source_.setExtraData(mock_source_); |
39 } | 39 } |
40 | 40 |
41 virtual ~MediaStreamVideoTrackTest() { | 41 ~MediaStreamVideoTrackTest() override {} |
42 } | |
43 | 42 |
44 virtual void TearDown() override { | 43 void TearDown() override { |
45 blink_source_.reset(); | 44 blink_source_.reset(); |
46 blink::WebHeap::collectAllGarbageForTesting(); | 45 blink::WebHeap::collectAllGarbageForTesting(); |
47 } | 46 } |
48 | 47 |
49 void DeliverVideoFrameAndWaitForRenderer(MockMediaStreamVideoSink* sink) { | 48 void DeliverVideoFrameAndWaitForRenderer(MockMediaStreamVideoSink* sink) { |
50 base::RunLoop run_loop; | 49 base::RunLoop run_loop; |
51 base::Closure quit_closure = run_loop.QuitClosure(); | 50 base::Closure quit_closure = run_loop.QuitClosure(); |
52 EXPECT_CALL(*sink, OnVideoFrame()).WillOnce( | 51 EXPECT_CALL(*sink, OnVideoFrame()).WillOnce( |
53 RunClosure(quit_closure)); | 52 RunClosure(quit_closure)); |
54 scoped_refptr<media::VideoFrame> frame = | 53 scoped_refptr<media::VideoFrame> frame = |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 MediaStreamVideoTrack* native_track2 = | 228 MediaStreamVideoTrack* native_track2 = |
230 MediaStreamVideoTrack::GetVideoTrack(track2); | 229 MediaStreamVideoTrack::GetVideoTrack(track2); |
231 native_track2->Stop(); | 230 native_track2->Stop(); |
232 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); | 231 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); |
233 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 232 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
234 blink_source().readyState()); | 233 blink_source().readyState()); |
235 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); | 234 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); |
236 } | 235 } |
237 | 236 |
238 } // namespace content | 237 } // namespace content |
OLD | NEW |