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

Side by Side Diff: content/renderer/media/media_stream_video_source_unittest.cc

Issue 2767963002: Revert of Remove |remote| and |readonly| members of MediaStreamTrack. (Closed)
Patch Set: rebase Created 3 years, 9 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 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 gfx::Size(1280, 720), 30, media::PIXEL_FORMAT_I420)); 45 gfx::Size(1280, 720), 30, media::PIXEL_FORMAT_I420));
46 formats.push_back(media::VideoCaptureFormat( 46 formats.push_back(media::VideoCaptureFormat(
47 gfx::Size(640, 480), 30, media::PIXEL_FORMAT_I420)); 47 gfx::Size(640, 480), 30, media::PIXEL_FORMAT_I420));
48 formats.push_back(media::VideoCaptureFormat( 48 formats.push_back(media::VideoCaptureFormat(
49 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420)); 49 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420));
50 formats.push_back(media::VideoCaptureFormat( 50 formats.push_back(media::VideoCaptureFormat(
51 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420)); 51 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420));
52 mock_source_->SetSupportedFormats(formats); 52 mock_source_->SetSupportedFormats(formats);
53 webkit_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), 53 webkit_source_.initialize(blink::WebString::fromASCII("dummy_source_id"),
54 blink::WebMediaStreamSource::TypeVideo, 54 blink::WebMediaStreamSource::TypeVideo,
55 blink::WebString::fromASCII("dummy_source_name")); 55 blink::WebString::fromASCII("dummy_source_name"),
56 false /* remote */);
56 webkit_source_.setExtraData(mock_source_); 57 webkit_source_.setExtraData(mock_source_);
57 } 58 }
58 59
59 void TearDown() override { 60 void TearDown() override {
60 webkit_source_.reset(); 61 webkit_source_.reset();
61 blink::WebHeap::collectAllGarbageForTesting(); 62 blink::WebHeap::collectAllGarbageForTesting();
62 } 63 }
63 64
64 protected: 65 protected:
65 // Create a track that's associated with |webkit_source_|. 66 // Create a track that's associated with |webkit_source_|.
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 TEST_F(MediaStreamVideoSourceTest, InvalidMandatoryAspectRatioFails) { 796 TEST_F(MediaStreamVideoSourceTest, InvalidMandatoryAspectRatioFails) {
796 MockConstraintFactory factory; 797 MockConstraintFactory factory;
797 factory.basic().aspectRatio.setMax(0.0); 798 factory.basic().aspectRatio.setMax(0.0);
798 blink::WebMediaStreamTrack track = 799 blink::WebMediaStreamTrack track =
799 CreateTrack("123", factory.CreateWebMediaConstraints()); 800 CreateTrack("123", factory.CreateWebMediaConstraints());
800 mock_source()->CompleteGetSupportedFormats(); 801 mock_source()->CompleteGetSupportedFormats();
801 EXPECT_EQ(1, NumberOfFailedConstraintsCallbacks()); 802 EXPECT_EQ(1, NumberOfFailedConstraintsCallbacks());
802 } 803 }
803 804
804 } // namespace content 805 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698