Index: chrome/test/data/indexeddb/perf_shared.js |
diff --git a/chrome/test/data/indexeddb/perf_shared.js b/chrome/test/data/indexeddb/perf_shared.js |
index 6fc6e315b3c208f54c6eefdffe06be673556cc3a..f335b0b5855b290d422efaa4a7305e481d37394a 100644 |
--- a/chrome/test/data/indexeddb/perf_shared.js |
+++ b/chrome/test/data/indexeddb/perf_shared.js |
@@ -193,12 +193,20 @@ function getDisplayName(args) { |
function padToWidth(s, width) { |
s = String(s); |
assert(s.length <= width); |
- while (s.length < width) { |
- s = "0" + s; |
+ if (s.length < width) { |
+ s = stringOfLength(width - s.length, '0') + s; |
} |
return s; |
} |
+function stringOfLength(n, c) { |
+ if (c == null) |
+ c = 'X'; |
+ assert(n > 0); |
+ assert(n == Math.floor(n)); |
+ return new Array(n + 1).join(c); |
+} |
+ |
function getSimpleKey(i) { |
return "key " + padToWidth(i, 10); |
} |
@@ -334,10 +342,3 @@ function getValuesFromCursor( |
} |
request.onerror = onError; |
} |
- |
- |
-function stringOfLength(n) { |
- assert(n > 0); |
- assert(n == Math.floor(n)); |
- return new Array(n + 1).join('0'); |
-} |