| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/optional.h" | 8 #include "base/optional.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 TEST_F(WebRtcVideoCapturerAdapterTest, Scale720To640360) { | 149 TEST_F(WebRtcVideoCapturerAdapterTest, Scale720To640360) { |
| 150 TestSourceCropFrame(1280, 720, 1280, 720, 640, 360); | 150 TestSourceCropFrame(1280, 720, 1280, 720, 640, 360); |
| 151 } | 151 } |
| 152 | 152 |
| 153 TEST_F(WebRtcVideoCapturerAdapterTest, SendsWithCopyTextureFrameCallback) { | 153 TEST_F(WebRtcVideoCapturerAdapterTest, SendsWithCopyTextureFrameCallback) { |
| 154 TestSourceTextureFrame(); | 154 TestSourceTextureFrame(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 TEST_F(WebRtcVideoCapturerAdapterTest, | 157 TEST_F(WebRtcVideoCapturerAdapterTest, |
| 158 NonScreencastAdapterDoesNotAdaptContentHintDetail) { | 158 NonScreencastAdapterDoesNotAdaptContentHintDetail) { |
| 159 // Non-screenshare adapter should not adapt frames when detailed is set. | 159 // Non-screenshare adapter should not adapt frames when detail is set. |
| 160 TestContentHintResolutionAdaptation( | 160 TestContentHintResolutionAdaptation( |
| 161 false, blink::WebMediaStreamTrack::ContentHintType::None, true, | 161 false, blink::WebMediaStreamTrack::ContentHintType::None, true, |
| 162 blink::WebMediaStreamTrack::ContentHintType::VideoDetailed, false); | 162 blink::WebMediaStreamTrack::ContentHintType::VideoDetail, false); |
| 163 } | 163 } |
| 164 | 164 |
| 165 TEST_F(WebRtcVideoCapturerAdapterTest, | 165 TEST_F(WebRtcVideoCapturerAdapterTest, |
| 166 NonScreencastAdapterAdaptsContentHintFluid) { | 166 NonScreencastAdapterAdaptsContentHintFluid) { |
| 167 // Non-screenshare adapter should still adapt frames when fluid is set. | 167 // Non-screenshare adapter should still adapt frames when motion is set. |
| 168 TestContentHintResolutionAdaptation( | 168 TestContentHintResolutionAdaptation( |
| 169 false, blink::WebMediaStreamTrack::ContentHintType::None, true, | 169 false, blink::WebMediaStreamTrack::ContentHintType::None, true, |
| 170 blink::WebMediaStreamTrack::ContentHintType::VideoFluid, true); | 170 blink::WebMediaStreamTrack::ContentHintType::VideoMotion, true); |
| 171 } | 171 } |
| 172 | 172 |
| 173 TEST_F(WebRtcVideoCapturerAdapterTest, | 173 TEST_F(WebRtcVideoCapturerAdapterTest, |
| 174 ScreencastAdapterAdaptsContentHintFluid) { | 174 ScreencastAdapterAdaptsContentHintFluid) { |
| 175 // Screenshare adapter should adapt frames when fluid is set. | 175 // Screenshare adapter should adapt frames when motion is set. |
| 176 TestContentHintResolutionAdaptation( | 176 TestContentHintResolutionAdaptation( |
| 177 true, blink::WebMediaStreamTrack::ContentHintType::None, false, | 177 true, blink::WebMediaStreamTrack::ContentHintType::None, false, |
| 178 blink::WebMediaStreamTrack::ContentHintType::VideoFluid, true); | 178 blink::WebMediaStreamTrack::ContentHintType::VideoMotion, true); |
| 179 } | 179 } |
| 180 | 180 |
| 181 TEST_F(WebRtcVideoCapturerAdapterTest, | 181 TEST_F(WebRtcVideoCapturerAdapterTest, |
| 182 ScreencastAdapterDoesNotAdaptContentHintDetailed) { | 182 ScreencastAdapterDoesNotAdaptContentHintDetailed) { |
| 183 // Screenshare adapter should still not adapt frames when detailed is set. | 183 // Screenshare adapter should still not adapt frames when detail is set. |
| 184 TestContentHintResolutionAdaptation( | 184 TestContentHintResolutionAdaptation( |
| 185 true, blink::WebMediaStreamTrack::ContentHintType::None, false, | 185 true, blink::WebMediaStreamTrack::ContentHintType::None, false, |
| 186 blink::WebMediaStreamTrack::ContentHintType::VideoDetailed, false); | 186 blink::WebMediaStreamTrack::ContentHintType::VideoDetail, false); |
| 187 } | 187 } |
| 188 | 188 |
| 189 TEST_F(WebRtcVideoCapturerAdapterTest, RespectsConstructionTimeContentHint) { | 189 TEST_F(WebRtcVideoCapturerAdapterTest, RespectsConstructionTimeContentHint) { |
| 190 // Non-screenshare adapter constructed with detailed content hint should not | 190 // Non-screenshare adapter constructed with detail content hint should not |
| 191 // adapt before SetContentHint is run. | 191 // adapt before SetContentHint is run. |
| 192 TestContentHintResolutionAdaptation( | 192 TestContentHintResolutionAdaptation( |
| 193 false, blink::WebMediaStreamTrack::ContentHintType::VideoDetailed, false, | 193 false, blink::WebMediaStreamTrack::ContentHintType::VideoDetail, false, |
| 194 blink::WebMediaStreamTrack::ContentHintType::VideoFluid, true); | 194 blink::WebMediaStreamTrack::ContentHintType::VideoMotion, true); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace content | 197 } // namespace content |
| OLD | NEW |