Changeset 97168 in webkit
- Timestamp:
- Oct 11, 2011 12:22:14 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r97166 r97168 1 2011-10-11 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: implement IDBFactory.cmp method 4 https://bugs.webkit.org/show_bug.cgi?id=62293 5 6 Reviewed by Tony Chang. 7 8 Check for IDBFactory.deleteDatabase (NYI) marked as FAIL. crbug.com/72002 9 Tests for array keys (NYI) marked as FAIL. crbug.com/99876 10 Tests for invalid key exception types marked as FAIL. crbug.com/98930 11 12 * storage/indexeddb/factory-basics-expected.txt: 13 * storage/indexeddb/factory-basics.html: 14 1 15 2011-10-11 Dimitri Glazkov <dglazkov@chromium.org> 2 16 -
trunk/LayoutTests/storage/indexeddb/factory-basics-expected.txt
r96054 r97168 6 6 indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB; 7 7 PASS indexedDB == null is false 8 PASS typeof indexedDB.open === 'function' is true 9 PASS typeof indexedDB.cmp === 'function' is true 10 PASS typeof indexedDB.getDatabaseNames === 'function' is true 11 deleteDatabase API is not yet implemented, so this will fail: 12 FAIL typeof indexedDB.deleteDatabase === 'function' should be true. Was false. 8 13 indexedDB.getDatabaseNames() 9 14 databaseNames = event.target.result -
trunk/LayoutTests/storage/indexeddb/factory-basics.html
r96054 r97168 15 15 layoutTestController.waitUntilDone(); 16 16 17 18 17 function test() 19 18 { 20 19 indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;"); 21 20 shouldBeFalse("indexedDB == null"); 21 22 shouldBeTrue("typeof indexedDB.open === 'function'"); 23 shouldBeTrue("typeof indexedDB.cmp === 'function'"); 24 shouldBeTrue("typeof indexedDB.getDatabaseNames === 'function'"); 25 26 debug("deleteDatabase API is not yet implemented, so this will fail:"); 27 shouldBeTrue("typeof indexedDB.deleteDatabase === 'function'"); 22 28 23 29 name = 'storage/indexeddb/factory-basics'; … … 56 62 57 63 // FIXME: test indexedDB.deleteDatabase(databaseName) 58 // FIXME: test indexedDB.cmp(key1, key2) 64 59 65 done(); 60 66 } -
trunk/Source/WebCore/ChangeLog
r97165 r97168 1 2011-10-11 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: implement IDBFactory.cmp method 4 https://bugs.webkit.org/show_bug.cgi?id=62293 5 6 Reviewed by Tony Chang. 7 8 * storage/IDBFactory.cpp: 9 (WebCore::IDBFactory::cmp): 10 * storage/IDBFactory.h: 11 * storage/IDBFactory.idl: 12 * storage/IDBKey.cpp: 13 (WebCore::IDBKey::compare): 14 (WebCore::IDBKey::isLessThan): 15 (WebCore::IDBKey::isEqual): 16 * storage/IDBKey.h: 17 1 18 2011-10-11 No'am Rosenthal <noam.rosenthal@nokia.com> 2 19 -
trunk/Source/WebCore/storage/IDBFactory.cpp
r96054 r97168 40 40 #include "IDBDatabaseException.h" 41 41 #include "IDBFactoryBackendInterface.h" 42 #include "IDBKey.h" 42 43 #include "IDBKeyRange.h" 43 44 #include "IDBRequest.h" … … 98 99 } 99 100 101 short IDBFactory::cmp(PassRefPtr<IDBKey> first, PassRefPtr<IDBKey> second, ExceptionCode& ec) 102 { 103 ASSERT(first); 104 ASSERT(second); 105 106 if (first->type() == IDBKey::NullType || second->type() == IDBKey::NullType) { 107 ec = IDBDatabaseException::DATA_ERR; 108 return 0; 109 } 110 111 return static_cast<short>(first->compare(second.get())); 112 } 113 100 114 } // namespace WebCore 101 115 -
trunk/Source/WebCore/storage/IDBFactory.h
r96054 r97168 59 59 PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&); 60 60 61 short cmp(PassRefPtr<IDBKey> first, PassRefPtr<IDBKey> second, ExceptionCode&); 62 61 63 private: 62 64 IDBFactory(IDBFactoryBackendInterface*); -
trunk/Source/WebCore/storage/IDBFactory.idl
r96054 r97168 33 33 [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name) 34 34 raises (IDBDatabaseException); 35 36 short cmp(in IDBKey first, in IDBKey second) 37 raises (IDBDatabaseException); 35 38 }; 36 39 -
trunk/Source/WebCore/storage/IDBKey.cpp
r95901 r97168 40 40 } 41 41 42 int IDBKey::compare(const IDBKey* other) const 43 { 44 ASSERT(other); 45 if (m_type != other->m_type) 46 return m_type > other->m_type ? -1 : 1; 47 48 switch (m_type) { 49 case StringType: 50 return -codePointCompare(other->m_string, m_string); 51 case DateType: 52 return (m_date < other->m_date) ? -1 : 53 (m_date > other->m_date) ? 1 : 0; 54 case NumberType: 55 return (m_number < other->m_number) ? -1 : 56 (m_number > other-> m_number) ? 1 : 0; 57 case NullType: 58 return 0; 59 } 60 61 ASSERT_NOT_REACHED(); 62 return 0; 63 } 64 42 65 bool IDBKey::isLessThan(const IDBKey* other) const 43 66 { 44 67 ASSERT(other); 45 if (other->m_type < m_type) 46 return true; 47 if (other->m_type > m_type) 48 return false; 49 50 switch (m_type) { 51 case StringType: 52 return codePointCompare(other->m_string, m_string) > 0; 53 case DateType: 54 return other->m_date > m_date; 55 case NumberType: 56 return other->m_number > m_number; 57 case NullType: 58 return true; 59 } 60 61 ASSERT_NOT_REACHED(); 62 return false; 68 return compare(other) == -1; 63 69 } 64 70 65 71 bool IDBKey::isEqual(const IDBKey* other) const 66 72 { 67 if (!other || other->m_type != m_type)73 if (!other) 68 74 return false; 69 75 70 switch (m_type) { 71 case StringType: 72 return other->m_string == m_string; 73 case DateType: 74 return other->m_date == m_date; 75 case NumberType: 76 return other->m_number == m_number; 77 case NullType: 78 return true; 79 } 80 81 ASSERT_NOT_REACHED(); 82 return false; 76 return !compare(other); 83 77 } 84 78 -
trunk/Source/WebCore/storage/IDBKey.h
r95901 r97168 98 98 } 99 99 100 int compare(const IDBKey* other) const; 100 101 bool isLessThan(const IDBKey* other) const; 101 102 bool isEqual(const IDBKey* other) const;
Note: See TracChangeset
for help on using the changeset viewer.