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

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

Issue 8414002: Update chromium tests for new IDBDatabase.transaction() restrictions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-enables the test 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 | chrome/test/data/indexeddb/transaction_run_forever.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 function test() { 5 function test() {
6 if (window.webkitStorageInfo) { 6 if (window.webkitStorageInfo) {
7 window.jsTestIsAsync = true; 7 window.jsTestIsAsync = true;
8 webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, 8 webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY,
9 initUsageCallback, 9 initUsageCallback,
10 unexpectedErrorCallback); 10 unexpectedErrorCallback);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 function startNewTransaction() { 67 function startNewTransaction() {
68 if (dataAdded > origReturnedQuota) { 68 if (dataAdded > origReturnedQuota) {
69 fail("dataAdded > quota " + dataAdded + " > " + origReturnedQuota); 69 fail("dataAdded > quota " + dataAdded + " > " + origReturnedQuota);
70 return; 70 return;
71 } 71 }
72 debug(""); 72 debug("");
73 debug("Starting new transaction."); 73 debug("Starting new transaction.");
74 74
75 var trans = db.transaction([], webkitIDBTransaction.READ_WRITE); 75 var trans = db.transaction(['test123'], webkitIDBTransaction.READ_WRITE);
76 trans.onabort = onAbort; 76 trans.onabort = onAbort;
77 trans.oncomplete = getQuotaAndUsage; 77 trans.oncomplete = getQuotaAndUsage;
78 var store = trans.objectStore('test123'); 78 var store = trans.objectStore('test123');
79 request = store.put({x: data}, dataAdded); 79 request = store.put({x: data}, dataAdded);
80 request.onerror = logError; 80 request.onerror = logError;
81 } 81 }
82 82
83 function getQuotaAndUsage() { 83 function getQuotaAndUsage() {
84 successfulWrites++; 84 successfulWrites++;
85 if (successfulWrites > maxExpectedWrites) { 85 if (successfulWrites > maxExpectedWrites) {
(...skipping 19 matching lines...) Expand all
105 done("Transaction aborted. Data added: " + displaySize(dataAdded)); 105 done("Transaction aborted. Data added: " + displaySize(dataAdded));
106 debug("There were " + successfulWrites + " successful writes"); 106 debug("There were " + successfulWrites + " successful writes");
107 } 107 }
108 108
109 function logError() { 109 function logError() {
110 debug("Error function called: (" + event.target.errorCode + ") " + 110 debug("Error function called: (" + event.target.errorCode + ") " +
111 event.target.webkitErrorMessage); 111 event.target.webkitErrorMessage);
112 event.preventDefault(); 112 event.preventDefault();
113 } 113 }
114 114
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/indexeddb/transaction_run_forever.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698