Changeset 122173 in webkit
- Timestamp:
- Jul 9, 2012 5:48:10 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122169 r122173 1 2012-07-09 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: A null or undefined storeNames argument to IDBDatabase::transaction() should be coerced to string 4 https://bugs.webkit.org/show_bug.cgi?id=90474 5 6 Reviewed by Tony Chang. 7 8 * storage/indexeddb/resources/transaction-basics.js: 9 (testInvalidMode): 10 (testDegenerateNames.request.onsuccess): 11 (testDegenerateNames.verifyDegenerateNames): 12 (testDegenerateNames): 13 * storage/indexeddb/transaction-basics-expected.txt: 14 1 15 2012-07-09 Vincent Scheib <scheib@chromium.org> 2 16 -
trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js
r121492 r122173 281 281 debug("Verify that specifying an invalid mode raises an exception"); 282 282 evalAndExpectException("db.transaction(['storeName'], 'lsakjdf')", "IDBDatabaseException.TYPE_ERR", "'TypeError'"); 283 finishJSTest(); 283 testDegenerateNames(); 284 } 285 286 function testDegenerateNames() 287 { 288 debug(""); 289 debug("Test that null and undefined are treated as strings"); 290 291 evalAndExpectException("db.transaction(null)", "DOMException.NOT_FOUND_ERR", "'NotFoundError'"); 292 evalAndExpectException("db.transaction(undefined)", "DOMException.NOT_FOUND_ERR", "'NotFoundError'"); 293 294 request = evalAndLog("db.setVersion('funny names')"); 295 request.onerror = unexpectedErrorCallback; 296 request.onsuccess = function () { 297 var trans = request.result; 298 evalAndLog("db.createObjectStore('null')"); 299 evalAndLog("db.createObjectStore('undefined')"); 300 trans.oncomplete = verifyDegenerateNames; 301 }; 302 function verifyDegenerateNames() { 303 shouldNotThrow("transaction = db.transaction(null)"); 304 shouldBeNonNull("transaction.objectStore('null')"); 305 shouldNotThrow("transaction = db.transaction(undefined)"); 306 shouldBeNonNull("transaction.objectStore('undefined')"); 307 finishJSTest(); 308 } 284 309 } 285 310 -
trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
r121492 r122173 203 203 PASS code is IDBDatabaseException.TYPE_ERR 204 204 PASS ename is 'TypeError' 205 206 Test that null and undefined are treated as strings 207 Expecting exception from db.transaction(null) 208 PASS Exception was thrown. 209 PASS code is DOMException.NOT_FOUND_ERR 210 PASS ename is 'NotFoundError' 211 Expecting exception from db.transaction(undefined) 212 PASS Exception was thrown. 213 PASS code is DOMException.NOT_FOUND_ERR 214 PASS ename is 'NotFoundError' 215 db.setVersion('funny names') 216 db.createObjectStore('null') 217 db.createObjectStore('undefined') 218 PASS transaction = db.transaction(null) did not throw exception. 219 PASS transaction.objectStore('null') is non-null. 220 PASS transaction = db.transaction(undefined) did not throw exception. 221 PASS transaction.objectStore('undefined') is non-null. 205 222 PASS successfullyParsed is true 206 223 -
trunk/Source/WebCore/ChangeLog
r122172 r122173 1 2012-07-09 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: A null or undefined storeNames argument to IDBDatabase::transaction() should be coerced to string 4 https://bugs.webkit.org/show_bug.cgi?id=90474 5 6 Reviewed by Tony Chang. 7 8 Test: storage/indexeddb/transaction-basics.html 9 10 * Modules/indexeddb/IDBDatabase.cpp: 11 (WebCore::IDBDatabase::transaction): 12 * Modules/indexeddb/IDBDatabase.idl: 13 1 14 2012-07-09 Joshua Bell <jsbell@chromium.org> 2 15 -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
r121488 r122173 208 208 { 209 209 RefPtr<DOMStringList> storeNames = prpStoreNames; 210 if (!storeNames || storeNames->isEmpty()) { 210 ASSERT(storeNames.get()); 211 if (storeNames->isEmpty()) { 211 212 ec = IDBDatabaseException::IDB_INVALID_ACCESS_ERR; 212 213 return 0; -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
r121817 r122173 46 46 [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version) 47 47 raises (IDBDatabaseException); 48 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList ?storeNames, in [Optional=DefaultIsNullString] DOMString mode)48 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode) 49 49 raises (IDBDatabaseException); 50 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] ?storeNames, in [Optional=DefaultIsNullString] DOMString mode)50 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsNullString] DOMString mode) 51 51 raises (IDBDatabaseException); 52 52 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsNullString] DOMString mode) … … 54 54 55 55 // FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed. 56 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList ?storeNames, in unsigned short mode)56 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode) 57 57 raises (IDBDatabaseException); 58 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] ?storeNames, in unsigned short mode)58 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode) 59 59 raises (IDBDatabaseException); 60 60 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode)
Note: See TracChangeset
for help on using the changeset viewer.