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

Unified Diff: chrome/test/data/webrtc/video_extraction.js

Issue 2123133003: Make video quality test fail cleaner if video hasn't started yet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Repurpose patch to fail test faster. Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/video_extraction.js
diff --git a/chrome/test/data/webrtc/video_extraction.js b/chrome/test/data/webrtc/video_extraction.js
index 5bfa923c94a0249cb16afb3d7e823d8fd75f91fb..95f83bda71bcd900a2fee1fb6117e41265581a00 100644
--- a/chrome/test/data/webrtc/video_extraction.js
+++ b/chrome/test/data/webrtc/video_extraction.js
@@ -36,10 +36,9 @@ var gFrames = [];
var gHasThrownAwayFirstTwoFrames = false;
/**
- * We need this global variable to synchronize with the test how long to run the
- * call between the two peers.
+ * A string to be returned to the test about the current status of capture.
*/
-var gDoneFrameCapturing = false;
+var gCapturingStatus = 'capturing-not-started';
/**
* Starts the frame capturing.
@@ -55,6 +54,7 @@ function startFrameCapture(videoTag, frameRate, duration) {
inputElement = document.getElementById("local-view");
var width = inputElement.videoWidth;
var height = inputElement.videoHeight;
+
// The WebRTC code is free to start in VGA, so make sure that the output video
// tag scales up to whatever the input size is (otherwise the video quality
// comparison will go poorly.
@@ -62,13 +62,16 @@ function startFrameCapture(videoTag, frameRate, duration) {
videoTag.height = height;
if (width == 0 || height == 0) {
- throw failTest('Trying to capture from ' + videoTag.id +
- ' but it is not playing any video.');
+ // Video must be playing at this point since this function is invoked from
+ // onplay on the <video> tag. See http://crbug.com/625943.
+ gCapturingStatus = 'failed-video-was-0x0-after-onplay'
+ return;
}
console.log('Received width is: ' + width + ', received height is: ' + height
+ ', capture interval is: ' + gFrameCaptureInterval +
', duration is: ' + gCaptureDuration);
+ gCapturingStatus = 'still-capturing';
var remoteCanvas = document.createElement('canvas');
remoteCanvas.width = width;
@@ -85,11 +88,7 @@ function startFrameCapture(videoTag, frameRate, duration) {
* Queries if we're done with the frame capturing yet.
*/
function doneFrameCapturing() {
- if (gDoneFrameCapturing) {
- returnToTest('done-capturing');
- } else {
- returnToTest('still-capturing');
- }
+ returnToTest(gCapturingStatus);
}
/**
@@ -169,7 +168,7 @@ function shoot_(video, canvas, width, height) {
gFrameCaptureInterval - diff);
} else {
// Done capturing!
- gDoneFrameCapturing = true;
+ gCapturingStatus = 'done-capturing';
prepareProgressBar_();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698