OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var overallTestStartTime = Date.now(); | 5 var overallTestStartTime = Date.now(); |
6 var kUseIndex = true; | 6 var kUseIndex = true; |
7 var kDontUseIndex = false; | 7 var kDontUseIndex = false; |
8 var kReadKeysOnly = true; | 8 var kReadKeysOnly = true; |
9 var kReadDataToo = false; | 9 var kReadDataToo = false; |
10 var kWriteToo = true; | 10 var kWriteToo = true; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 [testCreateAndDeleteIndex, 5000] | 82 [testCreateAndDeleteIndex, 5000] |
83 ]; | 83 ]; |
84 | 84 |
85 var currentTest = 0; | 85 var currentTest = 0; |
86 | 86 |
87 function test() { | 87 function test() { |
88 runNextTest(); | 88 runNextTest(); |
89 } | 89 } |
90 | 90 |
91 function runNextTest() { | 91 function runNextTest() { |
92 if (currentTest < tests.length) { | 92 var filter = window.location.hash.slice(1); |
| 93 do { |
93 var test = tests[currentTest++].slice(); | 94 var test = tests[currentTest++].slice(); |
94 var f = test.shift(); | 95 var f = test.shift(); |
| 96 } while (currentTest < tests.length && |
| 97 filter && f.name != filter) |
| 98 |
| 99 if (currentTest < tests.length) { |
95 test.push(runNextTest); | 100 test.push(runNextTest); |
96 f.apply(null, test); | 101 f.apply(null, test); |
97 } else { | 102 } else { |
98 onAllTestsComplete(); | 103 onAllTestsComplete(); |
99 } | 104 } |
100 } | 105 } |
101 | 106 |
102 function onAllTestsComplete() { | 107 function onAllTestsComplete() { |
103 var overallDuration = Date.now() - overallTestStartTime; | 108 var overallDuration = Date.now() - overallTestStartTime; |
104 automation.addResult("OverallTestDuration", overallDuration); | 109 automation.addResult("OverallTestDuration", overallDuration); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 433 |
429 var mode = "readonly"; | 434 var mode = "readonly"; |
430 if (numWritesPerTransaction) | 435 if (numWritesPerTransaction) |
431 mode = "readwrite"; | 436 mode = "readwrite"; |
432 | 437 |
433 var transaction = getTransaction(db, objectStoreNames, mode, batchComplete); | 438 var transaction = getTransaction(db, objectStoreNames, mode, batchComplete); |
434 putRandomValues(transaction, objectStoreNames, numWritesPerTransaction, | 439 putRandomValues(transaction, objectStoreNames, numWritesPerTransaction, |
435 numKeys); | 440 numKeys); |
436 } | 441 } |
437 } | 442 } |
OLD | NEW |