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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 blink_track_.initialize(blink_source_); | 60 blink_track_.initialize(blink_source_); |
61 | 61 |
62 blink::WebMediaConstraints constraints; | 62 blink::WebMediaConstraints constraints; |
63 constraints.initialize(); | 63 constraints.initialize(); |
64 track_ = new MediaStreamVideoTrack(mock_source_, constraints, | 64 track_ = new MediaStreamVideoTrack(mock_source_, constraints, |
65 MediaStreamSource::ConstraintsCallback(), | 65 MediaStreamSource::ConstraintsCallback(), |
66 true /* enabled */); | 66 true /* enabled */); |
67 blink_track_.setExtraData(track_); | 67 blink_track_.setExtraData(track_); |
68 | 68 |
69 video_track_recorder_.reset(new VideoTrackRecorder( | 69 video_track_recorder_.reset(new VideoTrackRecorder( |
70 GetParam().use_vp9 /* use_vp9 */, | 70 GetParam().use_vp9 /* use_vp9 */, blink_track_, |
71 blink_track_, | |
72 base::Bind(&VideoTrackRecorderTest::OnEncodedVideo, | 71 base::Bind(&VideoTrackRecorderTest::OnEncodedVideo, |
73 base::Unretained(this)))); | 72 base::Unretained(this)), |
| 73 0 /* bits_per_second */)); |
74 // Paranoia checks. | 74 // Paranoia checks. |
75 EXPECT_EQ(blink_track_.source().extraData(), blink_source_.extraData()); | 75 EXPECT_EQ(blink_track_.source().extraData(), blink_source_.extraData()); |
76 EXPECT_TRUE(message_loop_.IsCurrent()); | 76 EXPECT_TRUE(message_loop_.IsCurrent()); |
77 } | 77 } |
78 | 78 |
79 ~VideoTrackRecorderTest() { | 79 ~VideoTrackRecorderTest() { |
80 blink_track_.reset(); | 80 blink_track_.reset(); |
81 blink_source_.reset(); | 81 blink_source_.reset(); |
82 video_track_recorder_.reset(); | 82 video_track_recorder_.reset(); |
83 blink::WebHeap::collectAllGarbageForTesting(); | 83 blink::WebHeap::collectAllGarbageForTesting(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 third_frame_encoded_data.size()); | 176 third_frame_encoded_data.size()); |
177 | 177 |
178 Mock::VerifyAndClearExpectations(this); | 178 Mock::VerifyAndClearExpectations(this); |
179 } | 179 } |
180 | 180 |
181 INSTANTIATE_TEST_CASE_P(, | 181 INSTANTIATE_TEST_CASE_P(, |
182 VideoTrackRecorderTest, | 182 VideoTrackRecorderTest, |
183 ValuesIn(kTrackRecorderTestParams)); | 183 ValuesIn(kTrackRecorderTestParams)); |
184 | 184 |
185 } // namespace content | 185 } // namespace content |
OLD | NEW |