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

Unified Diff: chrome/test/data/media/html/utils.js

Issue 9960063: CNS seek tests for <video>. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-write. Created 8 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/media/html/utils.js
diff --git a/chrome/test/data/media/html/utils.js b/chrome/test/data/media/html/utils.js
index 7dff4bab7d66dce4fb7f86a73a17d439c884d93f..d0f8d647bd7aaf42577ce53289f02d22280a78c4 100644
--- a/chrome/test/data/media/html/utils.js
+++ b/chrome/test/data/media/html/utils.js
@@ -27,3 +27,31 @@ var QueryString = function () {
return params;
} ();
+
+function Timer() {
+ this.start_ = 0;
DaleCurtis 2012/04/18 18:57:53 Can this just be this.reset()?
shadi 2012/04/19 04:16:59 No, since reset is not defined at this point.
DaleCurtis 2012/04/19 19:42:10 Said no, but code shows you changed it?
shadi 2012/04/20 00:17:46 Actually I don't know how this got uploaded. This
+ this.times_ = [];
+}
+
+Timer.prototype = {
+ start: function() {
+ this.start_ = new Date().getTime();
+ },
+
+ stop: function() {
+ var delta = new Date().getTime() - this.start_;
+ this.times_.push(delta);
+ return delta;
+ },
+
+ reset: function() {
+ this.start_ = 0;
+ this.times_ = [];
+ }
+}
+
+// The purpose of generateSrc() is to return a unique URL based on original src.
+function generateSrc(src) {
DaleCurtis 2012/04/18 18:57:53 Better name? GenerateUniqueURL?
shadi 2012/04/19 04:16:59 Done.
+ var ch = src.indexOf('?') >= 0 ? '&' : '?';
+ return src + ch + 't=' + (new Date()).getTime();
+}

Powered by Google App Engine
This is Rietveld 408576698