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

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

Issue 247723006: Add HD browser test to WebRTC suite. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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

Powered by Google App Engine
This is Rietveld 408576698