Commit 9db32735 authored by Patrik Höglund's avatar Patrik Höglund Committed by Commit Bot

Remove WebRtcGetUserMediaBrowserTest.TwoGetUserMediaAndVerifyFrameRate.

The test doesn't do anything and hasn't for a while. I don't think it
can be salvaged because it's inherently a performance test. It will
inevitably be flaky.

We do have performance tests that cover frame rates, maybe not in
the "two getusermedia" case though.

Bug: 789121
Change-Id: I483096ed8ac18f4572245f93d1f2b2ccb2c473f2
Reviewed-on: https://chromium-review.googlesource.com/803348Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Patrik Höglund <phoglund@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521678}
parent 5952d4e4
...@@ -435,27 +435,6 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, ...@@ -435,27 +435,6 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
expected_result); expected_result);
} }
// Test fails under MSan, http://crbug.com/445745.
// Flaky everywhere: https://crbug.com/789121.
IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
DISABLED_TwoGetUserMediaAndVerifyFrameRate) {
ASSERT_TRUE(embedded_test_server()->Start());
GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
NavigateToURL(shell(), url);
std::string constraints1 =
"{video: {mandatory: {minWidth:640 , minHeight: 480, "
"minFrameRate : 15, maxFrameRate : 15}}}";
std::string constraints2 =
"{video: {mandatory: {maxWidth:320 , maxHeight: 240,"
"minFrameRate : 7, maxFrameRate : 7}}}";
std::string command = "twoGetUserMediaAndVerifyFrameRate(" +
constraints1 + ',' + constraints2 + ", 15, 7)";
ExecuteJavascriptAndWaitForOk(command);
}
IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
GetUserMediaWithTooHighVideoConstraintsValues) { GetUserMediaWithTooHighVideoConstraintsValues) {
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
......
...@@ -279,42 +279,6 @@ ...@@ -279,42 +279,6 @@
} }
} }
// Calls GetUserMedia twice and verify that the frame rate is as expected for
// both streams.
function twoGetUserMediaAndVerifyFrameRate(constraints1,
constraints2,
expectedFrameRate1,
expectedFrameRate2) {
function frameRateValid(videoElementName, expectedFrameRate) {
return detectVideoPlaying(videoElementName)
.then(() => {
return validateFrameRate(videoElementName, expectedFrameRate)
});
}
navigator.mediaDevices.getUserMedia(constraints1)
.then(stream1 => {
$('local-view-1').srcObject = stream1;
})
.then(() => {
return navigator.mediaDevices.getUserMedia(constraints2)
.then(stream2 => {
$('local-view-2').srcObject = stream2;
});
})
.catch(failTest)
.then(() => {
return Promise.all([
frameRateValid('local-view-1', expectedFrameRate1),
frameRateValid('local-view-2', expectedFrameRate2),
])
})
.catch(unexpectedFrameRateMsg => {
failTest(unexpectedFrameRateMsg);
})
.then(reportTestSuccess);
}
function getUserMediaInIframeAndCloseInSuccessCb(constraints) { function getUserMediaInIframeAndCloseInSuccessCb(constraints) {
var iframe = document.createElement('iframe'); var iframe = document.createElement('iframe');
iframe.onload = onIframeLoaded; iframe.onload = onIframeLoaded;
......
...@@ -111,47 +111,6 @@ function detectVideo(videoElementName, predicate) { ...@@ -111,47 +111,6 @@ function detectVideo(videoElementName, predicate) {
}); });
} }
// Calculates the current frame rate and compares to |expectedFrameRate|
// The promise is resolved with value |true| if the calculated frame rate
// is +-1 the expected or rejected with an error message if five calculations
// fail to match |expectedFrameRate|.
function validateFrameRate(videoElementName, expectedFrameRate) {
return new Promise((resolve, reject) => {
var videoElement = $(videoElementName);
var startTime = new Date().getTime();
var decodedFrames = videoElement.webkitDecodedFrameCount;
var attempts = 0;
if (videoElement.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA ||
videoElement.paused || videoElement.ended) {
reject("getFrameRate - " + videoElementName + " is not plaing.");
return;
}
var waitVideo = setInterval(function() {
attempts++;
currentTime = new Date().getTime();
deltaTime = (currentTime - startTime) / 1000;
startTime = currentTime;
// Calculate decoded frames per sec.
var fps =
(videoElement.webkitDecodedFrameCount - decodedFrames) / deltaTime;
decodedFrames = videoElement.webkitDecodedFrameCount;
console.log('FrameRate in ' + videoElementName + ' is ' + fps);
if (fps < expectedFrameRate + 1 && fps > expectedFrameRate - 1) {
clearInterval(waitVideo);
resolve(true);
} else if (attempts == 5) {
clearInterval(waitVideo);
reject('Expected frame rate ' + expectedFrameRate + ' for ' +
'element ' + videoElementName + ', but got ' + fps);
}
}, 1000);
});
}
function waitForConnectionToStabilize(peerConnection) { function waitForConnectionToStabilize(peerConnection) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
peerConnection.onsignalingstatechange = function(event) { peerConnection.onsignalingstatechange = function(event) {
......
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