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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 DeliverVideoFrameAndWaitForRenderer(&sink); | 117 DeliverVideoFrameAndWaitForRenderer(&sink); |
118 | 118 |
119 sink.DisconnectFromTrack(); | 119 sink.DisconnectFromTrack(); |
120 | 120 |
121 scoped_refptr<media::VideoFrame> frame = | 121 scoped_refptr<media::VideoFrame> frame = |
122 media::VideoFrame::CreateBlackFrame( | 122 media::VideoFrame::CreateBlackFrame( |
123 gfx::Size(MediaStreamVideoSource::kDefaultWidth, | 123 gfx::Size(MediaStreamVideoSource::kDefaultWidth, |
124 MediaStreamVideoSource::kDefaultHeight)); | 124 MediaStreamVideoSource::kDefaultHeight)); |
125 mock_source()->DeliverVideoFrame(frame); | 125 mock_source()->DeliverVideoFrame(frame); |
126 // Wait for the IO thread to complete delivering frames. | 126 // Wait for the IO thread to complete delivering frames. |
127 io_message_loop()->RunUntilIdle(); | 127 base::RunLoop().RunUntilIdle(); |
128 EXPECT_EQ(2, sink.number_of_frames()); | 128 EXPECT_EQ(2, sink.number_of_frames()); |
129 } | 129 } |
130 | 130 |
131 class CheckThreadHelper { | 131 class CheckThreadHelper { |
132 public: | 132 public: |
133 CheckThreadHelper(base::Closure callback, bool* correct) | 133 CheckThreadHelper(base::Closure callback, bool* correct) |
134 : callback_(callback), | 134 : callback_(callback), |
135 correct_(correct) { | 135 correct_(correct) { |
136 } | 136 } |
137 | 137 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 base::Closure quit_closure = run_loop.QuitClosure(); | 249 base::Closure quit_closure = run_loop.QuitClosure(); |
250 EXPECT_CALL(sink, OnVideoFrame()).WillOnce(RunClosure(quit_closure)); | 250 EXPECT_CALL(sink, OnVideoFrame()).WillOnce(RunClosure(quit_closure)); |
251 sink.ConnectToTrack(track); | 251 sink.ConnectToTrack(track); |
252 run_loop.Run(); | 252 run_loop.Run(); |
253 EXPECT_EQ(1, sink.number_of_frames()); | 253 EXPECT_EQ(1, sink.number_of_frames()); |
254 | 254 |
255 sink.DisconnectFromTrack(); | 255 sink.DisconnectFromTrack(); |
256 } | 256 } |
257 | 257 |
258 } // namespace content | 258 } // namespace content |
OLD | NEW |