Changeset 105376 in webkit


Ignore:
Timestamp:
Jan 18, 2012 8:07:54 PM (12 years ago)
Author:
rolandsteiner@chromium.org
Message:

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).

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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r105372 r105376  
     12012-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
    1132012-01-18  Andreas Kling  <awesomekling@apple.com>
    214
  • trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt

    r105331 r105376  
    1616db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})
    1717db.createObjectStore('PlainOldStore', {autoIncrement: false})
    18 db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true})
    1918storeNames = db.objectStoreNames
    2019PASS store.name is "StoreWithKeyPath"
     
    2322PASS storeNames.contains('StoreWithAutoIncrement') is true
    2423PASS storeNames.contains('PlainOldStore') is true
    25 PASS storeNames.length is 4
     24PASS storeNames.length is 3
    2625setVersionCompleted():
    2726trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)
     
    6463addAdamSuccess():
    6564PASS 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
    8765PASS successfullyParsed is true
    8866
  • trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement.html

    r105331 r105376  
    4444    evalAndLog("db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})");
    4545    evalAndLog("db.createObjectStore('PlainOldStore', {autoIncrement: false})");
    46     evalAndLog("db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement: true})");
    4746    var storeNames = evalAndLog("storeNames = db.objectStoreNames");
    4847
     
    5251    shouldBe("storeNames.contains('StoreWithAutoIncrement')", "true");
    5352    shouldBe("storeNames.contains('PlainOldStore')", "true");
    54     shouldBe("storeNames.length", "4");
     53    shouldBe("storeNames.length", "3");
    5554
    5655    // Let the setVersion transaction complete.
     
    6362    window.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], webkitIDBTransaction.READ_WRITE)");
    6463    trans.onabort = unexpectedAbortCallback;
    65     trans.oncomplete = testLongKeyPath;
     64    trans.oncomplete = done;
    6665
    6766    window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
     
    159158}
    160159
    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 
    200160test();
    201161
  • trunk/Source/WebCore/ChangeLog

    r105375 r105376  
     12012-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
    1132012-01-18  Raymond Liu  <raymond.liu@intel.com>
    214
  • trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp

    r105331 r105376  
    126126}
    127127
    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 
    147128} // anonymous namespace
    148129
     
    164145
    165146    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));
    167148    if (parent.IsEmpty())
    168149        return 0;
Note: See TracChangeset for help on using the changeset viewer.