Index: chrome/test/functional/perf/endure_graphs/js/common.js |
diff --git a/chrome/test/functional/perf/endure_graphs/js/common.js b/chrome/test/functional/perf/endure_graphs/js/common.js |
index 96399dc550188c7232c8e2c38af575eb4df33cea..dc12d1eebc7313c482edb051ae63df3d38237f8d 100644 |
--- a/chrome/test/functional/perf/endure_graphs/js/common.js |
+++ b/chrome/test/functional/perf/endure_graphs/js/common.js |
@@ -77,13 +77,16 @@ function ParseParams() { |
* @return {string} The URL constructed from the given params. |
*/ |
function MakeURL(params) { |
- var url = window.location.pathname; |
- var sep = '?'; |
- for (p in params) { |
- if (!p) |
- continue; |
- url += sep + p + '=' + params[p]; |
- sep = '&'; |
+ var arr = []; |
+ for (var p in params) { |
+ if (typeof params[p] == 'object') { |
+ // Repeated params, stored as hash like {valueA: 1, valueB: 1} |
+ for (var r in params[p]) { |
+ arr.push(p + '=' + r); |
alias of yukishiino
2012/11/02 04:19:19
I'm not sure if it's necessary to check the value
alias of yukishiino
2012/11/02 04:19:19
You should call encodeURIComponent for each value.
|
+ } |
+ } else { |
+ arr.push(p + '=' + params[p]); |
+ } |
} |
- return url; |
+ return window.location.pathname + '?' + arr.join('&'); |
} |