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

Side by Side Diff: chrome/test/data/indexeddb/perf_shared.js

Issue 10836063: Add deletion test, cursor read with writeback to same store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add bug number. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 window.indexedDB = window.indexedDB || window.webkitIndexedDB || 5 window.indexedDB = window.indexedDB || window.webkitIndexedDB ||
6 window.mozIndexedDB || window.msIndexedDB; 6 window.mozIndexedDB || window.msIndexedDB;
7 window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange; 7 window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
8 8
9 var automation = { 9 var automation = {
10 results: {} 10 results: {}
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 var oos; 326 var oos;
327 if (outputObjectStoreName) 327 if (outputObjectStoreName)
328 oos = transaction.objectStore(outputObjectStoreName); 328 oos = transaction.objectStore(outputObjectStoreName);
329 var numReadsLeft = numReads; 329 var numReadsLeft = numReads;
330 request.onsuccess = function(event) { 330 request.onsuccess = function(event) {
331 var cursor = event.target.result; 331 var cursor = event.target.result;
332 if (cursor) { 332 if (cursor) {
333 assert(numReadsLeft); 333 assert(numReadsLeft);
334 --numReadsLeft; 334 --numReadsLeft;
335 if (oos) // Put in random order for maximum difficulty. 335 if (oos)
336 oos.put(cursor.value, Math.random()); 336 // Put in random order for maximum difficulty. We add in numKeys just
337 // in case we're writing back to the same store; this way we won't
338 // affect the number of keys available to the cursor, since we're always
339 // outside its range.
340 oos.put(cursor.value, numKeys + Math.random());
337 values.push({key: cursor.key, value: cursor.value}); 341 values.push({key: cursor.key, value: cursor.value});
338 cursor.continue(); 342 cursor.continue();
339 } else { 343 } else {
340 assert(!numReadsLeft); 344 assert(!numReadsLeft);
341 } 345 }
342 } 346 }
343 request.onerror = onError; 347 request.onerror = onError;
344 } 348 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/indexeddb/perf_test.js » ('j') | chrome/test/data/indexeddb/perf_test.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698