| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/media_recorder/video_track_recorder.h" | 5 #include "content/renderer/media_recorder/video_track_recorder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/location.h" | 13 #include "base/location.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "content/child/child_process.h" | 18 #include "content/child/child_process.h" |
| 18 #include "content/renderer/media/media_stream_video_track.h" | 19 #include "content/renderer/media/media_stream_video_track.h" |
| 19 #include "content/renderer/media/mock_media_stream_video_source.h" | 20 #include "content/renderer/media/mock_media_stream_video_source.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 VideoTrackRecorderTest() | 63 VideoTrackRecorderTest() |
| 63 : mock_source_(new MockMediaStreamVideoSource(false)) { | 64 : mock_source_(new MockMediaStreamVideoSource(false)) { |
| 64 const blink::WebString webkit_track_id( | 65 const blink::WebString webkit_track_id( |
| 65 blink::WebString::fromASCII("dummy")); | 66 blink::WebString::fromASCII("dummy")); |
| 66 blink_source_.initialize(webkit_track_id, | 67 blink_source_.initialize(webkit_track_id, |
| 67 blink::WebMediaStreamSource::TypeVideo, | 68 blink::WebMediaStreamSource::TypeVideo, |
| 68 webkit_track_id); | 69 webkit_track_id); |
| 69 blink_source_.setExtraData(mock_source_); | 70 blink_source_.setExtraData(mock_source_); |
| 70 blink_track_.initialize(blink_source_); | 71 blink_track_.initialize(blink_source_); |
| 71 | 72 |
| 72 blink::WebMediaConstraints constraints; | 73 track_ = new MediaStreamVideoTrack(mock_source_, |
| 73 constraints.initialize(); | |
| 74 track_ = new MediaStreamVideoTrack(mock_source_, constraints, | |
| 75 MediaStreamSource::ConstraintsCallback(), | 74 MediaStreamSource::ConstraintsCallback(), |
| 76 true /* enabled */); | 75 true /* enabled */); |
| 77 blink_track_.setTrackData(track_); | 76 blink_track_.setTrackData(track_); |
| 78 | 77 |
| 79 // Paranoia checks. | 78 // Paranoia checks. |
| 80 EXPECT_EQ(blink_track_.source().getExtraData(), | 79 EXPECT_EQ(blink_track_.source().getExtraData(), |
| 81 blink_source_.getExtraData()); | 80 blink_source_.getExtraData()); |
| 82 EXPECT_TRUE(message_loop_.IsCurrent()); | 81 EXPECT_TRUE(message_loop_.IsCurrent()); |
| 83 } | 82 } |
| 84 | 83 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 Mock::VerifyAndClearExpectations(this); | 266 Mock::VerifyAndClearExpectations(this); |
| 268 } | 267 } |
| 269 | 268 |
| 270 INSTANTIATE_TEST_CASE_P(, | 269 INSTANTIATE_TEST_CASE_P(, |
| 271 VideoTrackRecorderTest, | 270 VideoTrackRecorderTest, |
| 272 ::testing::Combine(ValuesIn(kTrackRecorderTestCodec), | 271 ::testing::Combine(ValuesIn(kTrackRecorderTestCodec), |
| 273 ValuesIn(kTrackRecorderTestSize), | 272 ValuesIn(kTrackRecorderTestSize), |
| 274 ::testing::Bool())); | 273 ::testing::Bool())); |
| 275 | 274 |
| 276 } // namespace content | 275 } // namespace content |
| OLD | NEW |