Commit 0fce13aa authored by Sergey Silkin's avatar Sergey Silkin Committed by Commit Bot

Update and enable CanSetupH264VideoCallOnSupportedDevice.

- Ensure that call actually uses H264 by checking codec type in
video track stats.

- Enable CanSetupH264VideoCallOnSupportedDevice test.

Bug: webrtc:11244, 1047994
Change-Id: I5ba241828500de9e465d5200e651640394d2ce6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033511Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Sergey Silkin <ssilkin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742572}
parent ad1cfafa
...@@ -256,7 +256,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -256,7 +256,7 @@ IN_PROC_BROWSER_TEST_F(
// This test is to make sure HW H264 work normally on supported devices, since // This test is to make sure HW H264 work normally on supported devices, since
// there is no SW H264 fallback available on Android. // there is no SW H264 fallback available on Android.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
DISABLED_CanSetupH264VideoCallOnSupportedDevice) { CanSetupH264VideoCallOnSupportedDevice) {
MakeTypicalPeerConnectionCall("CanSetupH264VideoCallOnSupportedDevice();"); MakeTypicalPeerConnectionCall("CanSetupH264VideoCallOnSupportedDevice();");
} }
#endif #endif
......
...@@ -756,17 +756,36 @@ ...@@ -756,17 +756,36 @@
reportTestSuccess(); reportTestSuccess();
} }
function CanSetupH264VideoCallOnSupportedDevice() { async function CanSetupH264VideoCallOnSupportedDevice() {
createConnections(null); createConnections(null);
setOfferSdpTransform(maybePreferH264SendCodec); setOfferSdpTransform(maybePreferH264SendCodec);
navigator.mediaDevices.getUserMedia({audio: true, video: true}) navigator.mediaDevices.getUserMedia({audio: false, video: true})
.then(addStreamToBothConnectionsAndNegotiate) .then(addStreamToBothConnectionsAndNegotiate)
.catch(failTest); .catch(failTest);
Promise.all([ await detectVideoPlaying('remote-view-1');
detectVideoPlaying('remote-view-1'), await detectVideoPlaying('remote-view-2');
detectVideoPlaying('remote-view-1')
]).then(reportTestSuccess); assertEquals(gLocalStream.getVideoTracks().length, 1);
// Ensure that call uses H264.
gFirstConnection.getStats(gLocalStream.getVideoTracks()[0])
.then(function(report) {
var numCodecs = 0;
var hasH264 = false;
report.forEach(stats => {
if (stats.type == 'codec') {
numCodecs++;
if (stats.mimeType == 'video/H264') {
hasH264 = true;
}
}
});
assertEquals(1, numCodecs);
assertTrue(hasH264);
reportTestSuccess();
})
.catch(failTest);
} }
</script> </script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment