Index: tools/perf/page_sets/tough_video_cases/video.html |
diff --git a/tools/perf/page_sets/tough_video_cases/video.html b/tools/perf/page_sets/tough_video_cases/video.html |
index 0a0598844e995c8579c6ed4ecaf7291a96ccf95f..2c7c9a08a38db4ff1ae384f7e52eba674523420c 100644 |
--- a/tools/perf/page_sets/tough_video_cases/video.html |
+++ b/tools/perf/page_sets/tough_video_cases/video.html |
@@ -1,6 +1,37 @@ |
<!DOCTYPE html> |
<html> |
<body> |
- <video id="video_1" src="bear.webm" controls></video> |
</body> |
+ <script> |
+ function getQueryStrings() { |
+ // Gets query parameters from the URL; e.g., given a URL like: |
+ // |
+ // http://<url>/my.html?test=123&bob=456 |
+ // |
+ // returns params["test"] = 123, params["bob"]=456, etc. |
+ var params = {}; |
+ |
+ // RegEx to split out values by &. |
+ var r = /([^&=]+)=?([^&]*)/g; |
+ |
+ // Lambda function for decoding extracted match values. Replaces '+' with |
+ // space so decodeURIComponent functions properly. |
+ function d(s) { return decodeURIComponent(s.replace(/\+/g, ' ')); } |
+ |
+ var match; |
+ while (match = r.exec(window.location.search.substring(1))) |
+ params[d(match[1])] = d(match[2]); |
+ |
+ return params; |
+ } |
+ qsParams = getQueryStrings(); |
shadi
2013/07/18 17:00:02
*var* qsParams
|
+ if (qsParams["type"] != "") { |
+ testElement = document.createElement(qsParams["type"]); |
+ if (qsParams["id"] != "") |
+ testElement.id = qsParams["id"]; |
+ testElement.src = qsParams["src"]; |
+ testElement.controls = true; |
+ document.body.appendChild(testElement); |
+ } |
+ </script> |
</html> |