Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: content/renderer/media_recorder/video_track_recorder_unittest.cc

Issue 2790823002: Spec compliant video constraints for getUserMedia behind flag. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 Mock::VerifyAndClearExpectations(this); 291 Mock::VerifyAndClearExpectations(this);
293 } 292 }
294 293
295 INSTANTIATE_TEST_CASE_P(, 294 INSTANTIATE_TEST_CASE_P(,
296 VideoTrackRecorderTest, 295 VideoTrackRecorderTest,
297 ::testing::Combine(ValuesIn(kTrackRecorderTestCodec), 296 ::testing::Combine(ValuesIn(kTrackRecorderTestCodec),
298 ValuesIn(kTrackRecorderTestSize), 297 ValuesIn(kTrackRecorderTestSize),
299 ::testing::Bool())); 298 ::testing::Bool()));
300 299
301 } // namespace content 300 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698