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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 private: | 133 private: |
134 base::Closure callback_; | 134 base::Closure callback_; |
135 bool* correct_; | 135 bool* correct_; |
136 base::ThreadCheckerImpl thread_checker_; | 136 base::ThreadCheckerImpl thread_checker_; |
137 }; | 137 }; |
138 | 138 |
139 void CheckThreadVideoFrameReceiver( | 139 void CheckThreadVideoFrameReceiver( |
140 CheckThreadHelper* helper, | 140 CheckThreadHelper* helper, |
141 const scoped_refptr<media::VideoFrame>& frame, | 141 const scoped_refptr<media::VideoFrame>& frame, |
142 const media::VideoCaptureFormat& format, | |
143 const base::TimeTicks& estimated_capture_time) { | 142 const base::TimeTicks& estimated_capture_time) { |
144 // Do nothing. | 143 // Do nothing. |
145 } | 144 } |
146 | 145 |
147 // Checks that the callback given to the track is reset on the right thread. | 146 // Checks that the callback given to the track is reset on the right thread. |
148 TEST_F(MediaStreamVideoTrackTest, ResetCallbackOnThread) { | 147 TEST_F(MediaStreamVideoTrackTest, ResetCallbackOnThread) { |
149 MockMediaStreamVideoSink sink; | 148 MockMediaStreamVideoSink sink; |
150 blink::WebMediaStreamTrack track = CreateTrack(); | 149 blink::WebMediaStreamTrack track = CreateTrack(); |
151 | 150 |
152 base::RunLoop run_loop; | 151 base::RunLoop run_loop; |
(...skipping 76 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 |