Changeset 105378 in webkit
- Timestamp:
- Jan 18, 2012 9:20:17 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r105376 r105378 1 2012-01-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r105376. 4 http://trac.webkit.org/changeset/105376 5 https://bugs.webkit.org/show_bug.cgi?id=76601 6 7 Roll 76493 back in after discussion with jsbell (Requested by 8 rolandsteiner on #webkit). 9 10 * storage/indexeddb/objectstore-autoincrement-expected.txt: 11 * storage/indexeddb/objectstore-autoincrement.html: 12 1 13 2012-01-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 14 -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
r105376 r105378 16 16 db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true}) 17 17 db.createObjectStore('PlainOldStore', {autoIncrement: false}) 18 db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true}) 18 19 storeNames = db.objectStoreNames 19 20 PASS store.name is "StoreWithKeyPath" … … 22 23 PASS storeNames.contains('StoreWithAutoIncrement') is true 23 24 PASS storeNames.contains('PlainOldStore') is true 24 PASS storeNames.length is 325 PASS storeNames.length is 4 25 26 setVersionCompleted(): 26 27 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE) … … 63 64 addAdamSuccess(): 64 65 PASS event.target.result is 1 66 testLongKeyPath(): 67 trans = db.transaction('StoreWithLongKeyPath', webkitIDBTransaction.READ_WRITE) 68 store = trans.objectStore('StoreWithLongKeyPath') 69 store.add({foo: 'bar'}) 70 store.add({foo: 'bar', a: {}}) 71 store.add({foo: 'bar', a: {b: {}}}) 72 store.add({foo: 'bar', a: {b: {c: {}}}}) 73 store.openCursor() 74 expected = null 75 count = 0 76 expected = cursor.value.a.b.c.id + 1 77 PASS cursor.value.foo is 'bar' 78 PASS cursor.value.a.b.c.id is expected 79 expected = cursor.value.a.b.c.id + 1 80 PASS cursor.value.foo is 'bar' 81 PASS cursor.value.a.b.c.id is expected 82 expected = cursor.value.a.b.c.id + 1 83 PASS cursor.value.foo is 'bar' 84 PASS cursor.value.a.b.c.id is expected 85 expected = cursor.value.a.b.c.id + 1 86 PASS count is 4 65 87 PASS successfullyParsed is true 66 88 -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
r105376 r105378 44 44 evalAndLog("db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})"); 45 45 evalAndLog("db.createObjectStore('PlainOldStore', {autoIncrement: false})"); 46 evalAndLog("db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true})"); 46 47 var storeNames = evalAndLog("storeNames = db.objectStoreNames"); 47 48 … … 51 52 shouldBe("storeNames.contains('StoreWithAutoIncrement')", "true"); 52 53 shouldBe("storeNames.contains('PlainOldStore')", "true"); 53 shouldBe("storeNames.length", " 3");54 shouldBe("storeNames.length", "4"); 54 55 55 56 // Let the setVersion transaction complete. … … 62 63 window.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)"); 63 64 trans.onabort = unexpectedAbortCallback; 64 trans.oncomplete = done;65 trans.oncomplete = testLongKeyPath; 65 66 66 67 window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')"); … … 158 159 } 159 160 161 function testLongKeyPath() 162 { 163 debug("testLongKeyPath():"); 164 trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', webkitIDBTransaction.READ_WRITE)"); 165 trans.onabort = unexpectedAbortCallback; 166 trans.oncomplete = done; 167 168 store = evalAndLog("store = trans.objectStore('StoreWithLongKeyPath')"); 169 request = evalAndLog("store.add({foo: 'bar'})"); 170 request.onerror = unexpectedErrorCallback; 171 request = evalAndLog("store.add({foo: 'bar', a: {}})"); 172 request.onerror = unexpectedErrorCallback; 173 request = evalAndLog("store.add({foo: 'bar', a: {b: {}}})"); 174 request.onerror = unexpectedErrorCallback; 175 request = evalAndLog("store.add({foo: 'bar', a: {b: {c: {}}}})"); 176 request.onerror = unexpectedErrorCallback; 177 cursorRequest = evalAndLog("store.openCursor()"); 178 cursorRequest.onerror = unexpectedErrorCallback; 179 evalAndLog("expected = null"); 180 evalAndLog("count = 0"); 181 cursorRequest.onsuccess = function () { 182 cursor = cursorRequest.result; 183 if (!cursor) { 184 shouldBe("count", "4"); 185 return; 186 } 187 if (expected === null) { 188 evalAndLog("expected = cursor.value.a.b.c.id + 1"); 189 } else { 190 shouldBe("cursor.value.foo", "'bar'"); 191 shouldBe("cursor.value.a.b.c.id", "expected"); 192 evalAndLog("expected = cursor.value.a.b.c.id + 1"); 193 } 194 count++; 195 cursor.continue(); 196 }; 197 } 198 199 160 200 test(); 161 201 -
trunk/Source/WebCore/ChangeLog
r105377 r105378 1 2012-01-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r105376. 4 http://trac.webkit.org/changeset/105376 5 https://bugs.webkit.org/show_bug.cgi?id=76601 6 7 Roll 76493 back in after discussion with jsbell (Requested by 8 rolandsteiner on #webkit). 9 10 * bindings/v8/IDBBindingUtilities.cpp: 11 (WebCore::injectIDBKeyIntoSerializedValue): 12 1 13 2012-01-18 Ian Vollick <vollick@chromium.org> 2 14 -
trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
r105376 r105378 126 126 } 127 127 128 v8::Handle<v8::Value> ensureNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index) 129 { 130 v8::Handle<v8::Value> currentValue(rootValue); 131 132 ASSERT(index <= keyPathElements.size()); 133 for (size_t i = 0; i < index; ++i) { 134 v8::Handle<v8::Value> parentValue(currentValue); 135 const String& keyPathElement = keyPathElements[i]; 136 if (!get(currentValue, keyPathElement)) { 137 v8::Handle<v8::Object> object = v8::Object::New(); 138 if (!set(parentValue, keyPathElement, object)) 139 return v8::Handle<v8::Value>(); 140 currentValue = object; 141 } 142 } 143 144 return currentValue; 145 } 146 128 147 } // anonymous namespace 129 148 … … 145 164 146 165 v8::Handle<v8::Value> v8Value(value->deserialize()); 147 v8::Handle<v8::Value> parent( getNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1));166 v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1)); 148 167 if (parent.IsEmpty()) 149 168 return 0;
Note: See TracChangeset
for help on using the changeset viewer.