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 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 dataAdded += dataLength; | 81 dataAdded += dataLength; |
82 debug("We've added "+ displaySize(dataAdded)); | 82 debug("We've added "+ displaySize(dataAdded)); |
83 returnedUsage = usage; | 83 returnedUsage = usage; |
84 returnedQuota = quota; | 84 returnedQuota = quota; |
85 debug("Allotted quota is " + displaySize(returnedQuota)); | 85 debug("Allotted quota is " + displaySize(returnedQuota)); |
86 debug("LevelDB usage is " + displaySize(returnedUsage)); | 86 debug("LevelDB usage is " + displaySize(returnedUsage)); |
87 startNewTransaction(); | 87 startNewTransaction(); |
88 } | 88 } |
89 | 89 |
90 function onAbort() { | 90 function onAbort() { |
| 91 shouldBeEqualToString("event.target.error.name", "QuotaExceededError"); |
91 done("Transaction aborted. Data added: " + displaySize(dataAdded)); | 92 done("Transaction aborted. Data added: " + displaySize(dataAdded)); |
92 debug("There were " + successfulWrites + " successful writes"); | 93 debug("There were " + successfulWrites + " successful writes"); |
93 } | 94 } |
94 | 95 |
95 function logError() { | 96 function logError() { |
96 debug("Error function called: (" + event.target.errorCode + ") " + | 97 debug("Error function called: (" + event.target.errorCode + ") " + |
97 event.target.webkitErrorMessage); | 98 event.target.webkitErrorMessage); |
98 event.preventDefault(); | 99 event.preventDefault(); |
99 } | 100 } |
100 | 101 |
OLD | NEW |