| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 base::Closure callback_; | 132 base::Closure callback_; |
| 133 bool* correct_; | 133 bool* correct_; |
| 134 base::ThreadCheckerImpl thread_checker_; | 134 base::ThreadCheckerImpl thread_checker_; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 void CheckThreadVideoFrameReceiver( | 137 void CheckThreadVideoFrameReceiver( |
| 138 CheckThreadHelper* helper, | 138 CheckThreadHelper* helper, |
| 139 const scoped_refptr<media::VideoFrame>& frame, | 139 const scoped_refptr<media::VideoFrame>& frame, |
| 140 const base::TimeTicks& estimated_capture_time) { | 140 base::TimeTicks estimated_capture_time) { |
| 141 // Do nothing. | 141 // Do nothing. |
| 142 } | 142 } |
| 143 | 143 |
| 144 // Checks that the callback given to the track is reset on the right thread. | 144 // Checks that the callback given to the track is reset on the right thread. |
| 145 TEST_F(MediaStreamVideoTrackTest, ResetCallbackOnThread) { | 145 TEST_F(MediaStreamVideoTrackTest, ResetCallbackOnThread) { |
| 146 MockMediaStreamVideoSink sink; | 146 MockMediaStreamVideoSink sink; |
| 147 blink::WebMediaStreamTrack track = CreateTrack(); | 147 blink::WebMediaStreamTrack track = CreateTrack(); |
| 148 | 148 |
| 149 base::RunLoop run_loop; | 149 base::RunLoop run_loop; |
| 150 bool correct = false; | 150 bool correct = false; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 MediaStreamVideoTrack* const native_track2 = | 224 MediaStreamVideoTrack* const native_track2 = |
| 225 MediaStreamVideoTrack::GetVideoTrack(track2); | 225 MediaStreamVideoTrack::GetVideoTrack(track2); |
| 226 native_track2->Stop(); | 226 native_track2->Stop(); |
| 227 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); | 227 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink2.state()); |
| 228 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 228 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
| 229 blink_source().readyState()); | 229 blink_source().readyState()); |
| 230 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); | 230 MediaStreamVideoSink::RemoveFromVideoTrack(&sink2, track2); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace content | 233 } // namespace content |
| OLD | NEW |