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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 base::RunLoop run_loop; | 248 base::RunLoop run_loop; |
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 TEST_F(MediaStreamVideoTrackTest, GetSettings) { |
| 259 blink::WebMediaStreamTrack track = CreateTrack(); |
| 260 MediaStreamVideoTrack* const native_track = |
| 261 MediaStreamVideoTrack::GetVideoTrack(track); |
| 262 blink::WebMediaStreamTrack::Settings settings; |
| 263 native_track->getSettings(settings); |
| 264 // These values come straight from the mock video track implementation. |
| 265 EXPECT_EQ(640, settings.width); |
| 266 EXPECT_EQ(480, settings.height); |
| 267 EXPECT_EQ(30.0, settings.frameRate); |
| 268 EXPECT_EQ(blink::WebMediaStreamTrack::FacingMode::None, settings.facingMode); |
| 269 } |
| 270 |
258 } // namespace content | 271 } // namespace content |
OLD | NEW |