Changeset 105376 in webkit
- Timestamp:
- Jan 18, 2012 8:07:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r105372 r105376 1 2012-01-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r105331. 4 http://trac.webkit.org/changeset/105331 5 https://bugs.webkit.org/show_bug.cgi?id=76599 6 7 May have broken Chromium InjectIDBKey browser_test (Requested 8 by rolandsteiner on #webkit). 9 10 * storage/indexeddb/objectstore-autoincrement-expected.txt: 11 * storage/indexeddb/objectstore-autoincrement.html: 12 1 13 2012-01-18 Andreas Kling <awesomekling@apple.com> 2 14 -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
r105331 r105376 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})19 18 storeNames = db.objectStoreNames 20 19 PASS store.name is "StoreWithKeyPath" … … 23 22 PASS storeNames.contains('StoreWithAutoIncrement') is true 24 23 PASS storeNames.contains('PlainOldStore') is true 25 PASS storeNames.length is 424 PASS storeNames.length is 3 26 25 setVersionCompleted(): 27 26 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE) … … 64 63 addAdamSuccess(): 65 64 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 = null75 count = 076 expected = cursor.value.a.b.c.id + 177 PASS cursor.value.foo is 'bar'78 PASS cursor.value.a.b.c.id is expected79 expected = cursor.value.a.b.c.id + 180 PASS cursor.value.foo is 'bar'81 PASS cursor.value.a.b.c.id is expected82 expected = cursor.value.a.b.c.id + 183 PASS cursor.value.foo is 'bar'84 PASS cursor.value.a.b.c.id is expected85 expected = cursor.value.a.b.c.id + 186 PASS count is 487 65 PASS successfullyParsed is true 88 66 -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
r105331 r105376 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})");47 46 var storeNames = evalAndLog("storeNames = db.objectStoreNames"); 48 47 … … 52 51 shouldBe("storeNames.contains('StoreWithAutoIncrement')", "true"); 53 52 shouldBe("storeNames.contains('PlainOldStore')", "true"); 54 shouldBe("storeNames.length", " 4");53 shouldBe("storeNames.length", "3"); 55 54 56 55 // Let the setVersion transaction complete. … … 63 62 window.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)"); 64 63 trans.onabort = unexpectedAbortCallback; 65 trans.oncomplete = testLongKeyPath;64 trans.oncomplete = done; 66 65 67 66 window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')"); … … 159 158 } 160 159 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 200 160 test(); 201 161 -
trunk/Source/WebCore/ChangeLog
r105375 r105376 1 2012-01-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r105331. 4 http://trac.webkit.org/changeset/105331 5 https://bugs.webkit.org/show_bug.cgi?id=76599 6 7 May have broken Chromium InjectIDBKey browser_test (Requested 8 by rolandsteiner on #webkit). 9 10 * bindings/v8/IDBBindingUtilities.cpp: 11 (WebCore::injectIDBKeyIntoSerializedValue): 12 1 13 2012-01-18 Raymond Liu <raymond.liu@intel.com> 2 14 -
trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
r105331 r105376 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 147 128 } // anonymous namespace 148 129 … … 164 145 165 146 v8::Handle<v8::Value> v8Value(value->deserialize()); 166 v8::Handle<v8::Value> parent( ensureNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1));147 v8::Handle<v8::Value> parent(getNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1)); 167 148 if (parent.IsEmpty()) 168 149 return 0;
Note: See TracChangeset
for help on using the changeset viewer.