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

Unified Diff: content/test/data/media/webrtc_test_utilities.js

Issue 640253002: Speeding up TwoGetUserMediaAndStop WebRTC test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/data/media/getusermedia.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/webrtc_test_utilities.js
diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js
index 02aac59b325d27b8711e000f03a5027db4f52243..0f8f0a947da5e9814d1528698cd77195ddc47ee3 100644
--- a/content/test/data/media/webrtc_test_utilities.js
+++ b/content/test/data/media/webrtc_test_utilities.js
@@ -113,7 +113,8 @@ function waitForBlackVideo(videoElement) {
// Calculates the current frame rate and compares to |expected_frame_rate|
// |callback| is triggered with value |true| if the calculated frame rate
// is +-1 the expected or |false| if five calculations fail to match
-// |expected_frame_rate|.
+// |expected_frame_rate|. Calls back with OK if the check passed, otherwise
+// an error message.
function validateFrameRate(videoElementName, expected_frame_rate, callback) {
var videoElement = $(videoElementName);
var startTime = new Date().getTime();
@@ -140,10 +141,11 @@ function validateFrameRate(videoElementName, expected_frame_rate, callback) {
console.log('FrameRate in ' + videoElementName + ' is ' + fps);
if (fps < expected_frame_rate + 1 && fps > expected_frame_rate - 1) {
clearInterval(waitVideo);
- callback(true);
+ callback('OK');
} else if (attempts == 5) {
clearInterval(waitVideo);
- callback(false);
+ callback('Expected frame rate ' + expected_frame_rate + ' for ' +
+ 'element ' + videoElementName + ', but got ' + fps);
}
}, 1000);
}
« no previous file with comments | « content/test/data/media/getusermedia.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698