Unreviewed, rolling out r105331.
authorrolandsteiner@chromium.org <rolandsteiner@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 04:07:54 +0000 (04:07 +0000)
committerrolandsteiner@chromium.org <rolandsteiner@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 04:07:54 +0000 (04:07 +0000)
http://trac.webkit.org/changeset/105331
https://bugs.webkit.org/show_bug.cgi?id=76599

May have broken Chromium InjectIDBKey browser_test (Requested
by rolandsteiner on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-18

Source/WebCore:

* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoSerializedValue):

LayoutTests:

* storage/indexeddb/objectstore-autoincrement-expected.txt:
* storage/indexeddb/objectstore-autoincrement.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105376 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
LayoutTests/storage/indexeddb/objectstore-autoincrement.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/IDBBindingUtilities.cpp

index 7fcc074..c6681e7 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-18  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105331.
+        http://trac.webkit.org/changeset/105331
+        https://bugs.webkit.org/show_bug.cgi?id=76599
+
+        May have broken Chromium InjectIDBKey browser_test (Requested
+        by rolandsteiner on #webkit).
+
+        * storage/indexeddb/objectstore-autoincrement-expected.txt:
+        * storage/indexeddb/objectstore-autoincrement.html:
+
 2012-01-18  Andreas Kling  <awesomekling@apple.com>
 
         Cache and reuse the NodeList returned by Node::childNodes().
index 5e8489b..48b11bb 100644 (file)
@@ -15,14 +15,13 @@ createObjectStore():
 store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})
 db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})
 db.createObjectStore('PlainOldStore', {autoIncrement: false})
-db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true})
 storeNames = db.objectStoreNames
 PASS store.name is "StoreWithKeyPath"
 PASS store.keyPath is 'id'
 PASS storeNames.contains('StoreWithKeyPath') is true
 PASS storeNames.contains('StoreWithAutoIncrement') is true
 PASS storeNames.contains('PlainOldStore') is true
-PASS storeNames.length is 4
+PASS storeNames.length is 3
 setVersionCompleted():
 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)
 store = trans.objectStore('StoreWithKeyPath')
@@ -63,27 +62,6 @@ PASS code is webkitIDBDatabaseException.DATA_ERR
 store.add({name: 'Adam'}, 1)
 addAdamSuccess():
 PASS event.target.result is 1
-testLongKeyPath():
-trans = db.transaction('StoreWithLongKeyPath', webkitIDBTransaction.READ_WRITE)
-store = trans.objectStore('StoreWithLongKeyPath')
-store.add({foo: 'bar'})
-store.add({foo: 'bar', a: {}})
-store.add({foo: 'bar', a: {b: {}}})
-store.add({foo: 'bar', a: {b: {c: {}}}})
-store.openCursor()
-expected = null
-count = 0
-expected = cursor.value.a.b.c.id + 1
-PASS cursor.value.foo is 'bar'
-PASS cursor.value.a.b.c.id is expected
-expected = cursor.value.a.b.c.id + 1
-PASS cursor.value.foo is 'bar'
-PASS cursor.value.a.b.c.id is expected
-expected = cursor.value.a.b.c.id + 1
-PASS cursor.value.foo is 'bar'
-PASS cursor.value.a.b.c.id is expected
-expected = cursor.value.a.b.c.id + 1
-PASS count is 4
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 718e0e6..fb804cf 100644 (file)
@@ -43,7 +43,6 @@ function setVersionSuccess()
     window.store = evalAndLog("store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})");
     evalAndLog("db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})");
     evalAndLog("db.createObjectStore('PlainOldStore', {autoIncrement: false})");
-    evalAndLog("db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true})");
     var storeNames = evalAndLog("storeNames = db.objectStoreNames");
 
     shouldBeEqualToString("store.name", "StoreWithKeyPath");
@@ -51,7 +50,7 @@ function setVersionSuccess()
     shouldBe("storeNames.contains('StoreWithKeyPath')", "true");
     shouldBe("storeNames.contains('StoreWithAutoIncrement')", "true");
     shouldBe("storeNames.contains('PlainOldStore')", "true");
-    shouldBe("storeNames.length", "4");
+    shouldBe("storeNames.length", "3");
 
     // Let the setVersion transaction complete.
 }
@@ -62,7 +61,7 @@ function setVersionCompleted()
 
     window.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)");
     trans.onabort = unexpectedAbortCallback;
-    trans.oncomplete = testLongKeyPath;
+    trans.oncomplete = done;
 
     window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
 
@@ -158,45 +157,6 @@ function addAdamSuccess()
     shouldBe("event.target.result", "1");
 }
 
-function testLongKeyPath()
-{
-    debug("testLongKeyPath():");
-    trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', webkitIDBTransaction.READ_WRITE)");
-    trans.onabort = unexpectedAbortCallback;
-    trans.oncomplete = done;
-
-    store = evalAndLog("store = trans.objectStore('StoreWithLongKeyPath')");
-    request = evalAndLog("store.add({foo: 'bar'})");
-    request.onerror = unexpectedErrorCallback;
-    request = evalAndLog("store.add({foo: 'bar', a: {}})");
-    request.onerror = unexpectedErrorCallback;
-    request = evalAndLog("store.add({foo: 'bar', a: {b: {}}})");
-    request.onerror = unexpectedErrorCallback;
-    request = evalAndLog("store.add({foo: 'bar', a: {b: {c: {}}}})");
-    request.onerror = unexpectedErrorCallback;
-    cursorRequest = evalAndLog("store.openCursor()");
-    cursorRequest.onerror = unexpectedErrorCallback;
-    evalAndLog("expected = null");
-    evalAndLog("count = 0");
-    cursorRequest.onsuccess = function () {
-        cursor = cursorRequest.result;
-        if (!cursor) {
-            shouldBe("count", "4");
-            return;
-        }
-        if (expected === null) {
-            evalAndLog("expected = cursor.value.a.b.c.id + 1");
-        } else {
-            shouldBe("cursor.value.foo", "'bar'");
-            shouldBe("cursor.value.a.b.c.id", "expected");
-            evalAndLog("expected = cursor.value.a.b.c.id + 1");
-        }
-        count++;
-        cursor.continue();
-    };
-}
-
-
 test();
 
 
index 292ec01..06e851c 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-18  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105331.
+        http://trac.webkit.org/changeset/105331
+        https://bugs.webkit.org/show_bug.cgi?id=76599
+
+        May have broken Chromium InjectIDBKey browser_test (Requested
+        by rolandsteiner on #webkit).
+
+        * bindings/v8/IDBBindingUtilities.cpp:
+        (WebCore::injectIDBKeyIntoSerializedValue):
+
 2012-01-18  Raymond Liu  <raymond.liu@intel.com>
 
         Remove some unused code in AudioContext
index d0fb1ce..dba15e3 100644 (file)
@@ -125,25 +125,6 @@ v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, con
     return currentValue;
 }
 
-v8::Handle<v8::Value> ensureNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index)
-{
-    v8::Handle<v8::Value> currentValue(rootValue);
-
-    ASSERT(index <= keyPathElements.size());
-    for (size_t i = 0; i < index; ++i) {
-        v8::Handle<v8::Value> parentValue(currentValue);
-        const String& keyPathElement = keyPathElements[i];
-        if (!get(currentValue, keyPathElement)) {
-            v8::Handle<v8::Object> object = v8::Object::New();
-            if (!set(parentValue, keyPathElement, object))
-                return v8::Handle<v8::Value>();
-            currentValue = object;
-        }
-    }
-
-    return currentValue;
-}
-
 } // anonymous namespace
 
 PassRefPtr<IDBKey> createIDBKeyFromSerializedValueAndKeyPath(PassRefPtr<SerializedScriptValue> value, const Vector<String>& keyPath)
@@ -163,7 +144,7 @@ PassRefPtr<SerializedScriptValue> injectIDBKeyIntoSerializedValue(PassRefPtr<IDB
         return 0;
 
     v8::Handle<v8::Value> v8Value(value->deserialize());
-    v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1));
+    v8::Handle<v8::Value> parent(getNthValueOnKeyPath(v8Value, keyPath, keyPath.size() - 1));
     if (parent.IsEmpty())
         return 0;