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(); |
+} |