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

Unified Diff: tools/perf/page_sets/tough_video_cases/video.html

Issue 19623003: First page-set for media-related metrics measurement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define frequently used action at top of page-set. Created 7 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
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>

Powered by Google App Engine
This is Rietveld 408576698