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

Side by Side Diff: tools/page_cycler/indexed_db/basic_insert/index.html

Issue 8341080: Fix IndexedDB test to explicitly list transactions. Required by WebKit change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <title>Basic Insert</title> 3 <title>Basic Insert</title>
4 <script src="../head.js"></script> 4 <script src="../head.js"></script>
5 <script src="../common.js"></script> 5 <script src="../common.js"></script>
6 <script> 6 <script>
7 var RECORDS = 3000; 7 var RECORDS = 3000;
8 8
9 var failed = false; 9 var failed = false;
10 function error(event) { 10 function error(event) {
(...skipping 30 matching lines...) Expand all
41 transaction.onerror = error; 41 transaction.onerror = error;
42 transaction.oncomplete = storeCreated; 42 transaction.oncomplete = storeCreated;
43 43
44 while (db.objectStoreNames.length) 44 while (db.objectStoreNames.length)
45 db.deleteObjectStore(db.objectStoreNames[0]); 45 db.deleteObjectStore(db.objectStoreNames[0]);
46 46
47 db.createObjectStore('store'); 47 db.createObjectStore('store');
48 } 48 }
49 49
50 function storeCreated() { 50 function storeCreated() {
51 var transaction = db.transaction([], IDBTransaction.READ_WRITE); 51 var transaction = db.transaction(['store'], IDBTransaction.READ_WRITE);
52 transaction.oncomplete = insertsDone; 52 transaction.oncomplete = insertsDone;
53 transaction.onabort = error; 53 transaction.onabort = error;
54 54
55 var objectStore = transaction.objectStore('store'); 55 var objectStore = transaction.objectStore('store');
56 log('Inserting ' + RECORDS + ' records with explicit key.'); 56 log('Inserting ' + RECORDS + ' records with explicit key.');
57 startTime = new Date(); 57 startTime = new Date();
58 for (var i = 0; i < RECORDS; i++) { 58 for (var i = 0; i < RECORDS; i++) {
59 var x = Math.floor(Math.random() * 1000000); 59 var x = Math.floor(Math.random() * 1000000);
60 objectStore.put(x, x).onerror = error; 60 objectStore.put(x, x).onerror = error;
61 } 61 }
62 } 62 }
63 63
64 function insertsDone() { 64 function insertsDone() {
65 var now = Date.now(); 65 var now = Date.now();
66 var diff = now - startTime; 66 var diff = now - startTime;
67 log('Inserted ' + RECORDS + ' records in ' + diff + ' ms (' + diff / 67 log('Inserted ' + RECORDS + ' records in ' + diff + ' ms (' + diff /
68 RECORDS + ' ms per record)'); 68 RECORDS + ' ms per record)');
69 69
70 if (!failed) 70 if (!failed)
71 testComplete(now - startTime); 71 testComplete(now - startTime);
72 } 72 }
73 </script> 73 </script>
74 74
75 <body onLoad="start()"> 75 <body onLoad="start()">
76 </body> 76 </body>
77 </html> 77 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698