Index: chrome/test/data/webrtc/video_detector.js |
diff --git a/chrome/test/data/webrtc/video_detector.js b/chrome/test/data/webrtc/video_detector.js |
index 3c10813aad7058ffe8c58033ad60a0599821c495..0087298df31026ef02e5c08fae82cfc4e6fd3ced 100644 |
--- a/chrome/test/data/webrtc/video_detector.js |
+++ b/chrome/test/data/webrtc/video_detector.js |
@@ -48,6 +48,30 @@ function startDetection(videoElementId, width, height) { |
} |
/** |
+ * Verifies that the video stream connected to a video tag has the right width |
+ * and height. |
+ * |
+ * @param {string} videoElementId The video element to analyze. |
+ * @param {int} width The expected video width. |
+ * @param {int} width The expected video height. |
+ * |
+ * @return {string} Returns 'ok' if passing (exception is thrown on failure). |
+ */ |
+function verifyVideoStreamSize(videoElementId, expectedWidth, expectedHeight) { |
+ var videoTag = document.getElementById(videoElementId); |
+ console.log('videoTag' + videoTag); |
+ if (videoTag.videoWidth == expectedWidth && |
+ videoTag.videoHeight == expectedHeight) { |
+ returnToTest('ok-video-stream-size'); |
+ } |
+ else { |
+ throw failTest('Invalid video stream size: ' + videoTag.videoWidth + |
+ 'x' + videoTag.videoHeight + ' (expected: ' + expectedWidth + 'x' + |
+ expectedHeight + ')'); |
+ } |
+} |
+ |
+/** |
* Checks if we have detected any video so far. |
* |
* @return {string} video-playing if we detected video, otherwise |