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 23 matching lines...) Expand all Loading... |
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 virtual ~MediaStreamVideoTrackTest() { |
42 } | 42 } |
43 | 43 |
44 virtual void TearDown() OVERRIDE { | 44 virtual void TearDown() override { |
45 blink_source_.reset(); | 45 blink_source_.reset(); |
46 blink::WebHeap::collectAllGarbageForTesting(); | 46 blink::WebHeap::collectAllGarbageForTesting(); |
47 } | 47 } |
48 | 48 |
49 void DeliverVideoFrameAndWaitForRenderer(MockMediaStreamVideoSink* sink) { | 49 void DeliverVideoFrameAndWaitForRenderer(MockMediaStreamVideoSink* sink) { |
50 base::RunLoop run_loop; | 50 base::RunLoop run_loop; |
51 base::Closure quit_closure = run_loop.QuitClosure(); | 51 base::Closure quit_closure = run_loop.QuitClosure(); |
52 EXPECT_CALL(*sink, OnVideoFrame()).WillOnce( | 52 EXPECT_CALL(*sink, OnVideoFrame()).WillOnce( |
53 RunClosure(quit_closure)); | 53 RunClosure(quit_closure)); |
54 scoped_refptr<media::VideoFrame> frame = | 54 scoped_refptr<media::VideoFrame> frame = |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 MediaStreamVideoTrack* native_track2 = | 229 MediaStreamVideoTrack* native_track2 = |
230 MediaStreamVideoTrack::GetVideoTrack(track2); | 230 MediaStreamVideoTrack::GetVideoTrack(track2); |
231 native_track2->Stop(); | 231 native_track2->Stop(); |
232 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); | 232 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); |
233 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 233 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
234 blink_source().readyState()); | 234 blink_source().readyState()); |
235 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); | 235 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); |
236 } | 236 } |
237 | 237 |
238 } // namespace content | 238 } // namespace content |
OLD | NEW |