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

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

Issue 2644853002: Use explicit WebString conversion methods in content/renderer/media (unittests) (Closed)
Patch Set: Created 3 years, 11 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 media::VideoCaptureFormats formats; 43 media::VideoCaptureFormats formats;
44 formats.push_back(media::VideoCaptureFormat( 44 formats.push_back(media::VideoCaptureFormat(
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(base::UTF8ToUTF16("dummy_source_id"), 53 webkit_source_.initialize(blink::WebString::fromASCII("dummy_source_id"),
54 blink::WebMediaStreamSource::TypeVideo, 54 blink::WebMediaStreamSource::TypeVideo,
55 base::UTF8ToUTF16("dummy_source_name"), 55 blink::WebString::fromASCII("dummy_source_name"),
56 false /* remote */); 56 false /* remote */);
57 webkit_source_.setExtraData(mock_source_); 57 webkit_source_.setExtraData(mock_source_);
58 } 58 }
59 59
60 void TearDown() override { 60 void TearDown() override {
61 webkit_source_.reset(); 61 webkit_source_.reset();
62 blink::WebHeap::collectAllGarbageForTesting(); 62 blink::WebHeap::collectAllGarbageForTesting();
63 } 63 }
64 64
65 protected: 65 protected:
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 TEST_F(MediaStreamVideoSourceTest, InvalidMandatoryAspectRatioFails) { 796 TEST_F(MediaStreamVideoSourceTest, InvalidMandatoryAspectRatioFails) {
797 MockConstraintFactory factory; 797 MockConstraintFactory factory;
798 factory.basic().aspectRatio.setMax(0.0); 798 factory.basic().aspectRatio.setMax(0.0);
799 blink::WebMediaStreamTrack track = 799 blink::WebMediaStreamTrack track =
800 CreateTrack("123", factory.CreateWebMediaConstraints()); 800 CreateTrack("123", factory.CreateWebMediaConstraints());
801 mock_source()->CompleteGetSupportedFormats(); 801 mock_source()->CompleteGetSupportedFormats();
802 EXPECT_EQ(1, NumberOfFailedConstraintsCallbacks()); 802 EXPECT_EQ(1, NumberOfFailedConstraintsCallbacks());
803 } 803 }
804 804
805 } // namespace content 805 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698