[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jorlow at chromium.org jorlow at chromium.org
Wed Dec 22 13:41:43 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0fb2ee72be439f73eb1da4cf1c71776e98ea26ab
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 23 17:32:52 2010 +0000

    2010-09-23  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            IndexedDB shouldn't crash on invalid index names
            https://bugs.webkit.org/show_bug.cgi?id=46362
    
            * storage/indexeddb/objectstore-basics-expected.txt:
            * storage/indexeddb/objectstore-basics.html:
    2010-09-23  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            IndexedDB shouldn't crash on invalid index names
            https://bugs.webkit.org/show_bug.cgi?id=46362
    
            For now, return null.  In a later patch, we'll do proper exception raising.
    
            * storage/IDBObjectStore.cpp:
            (WebCore::IDBObjectStore::index):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4936146..d83e98d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-23  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        IndexedDB shouldn't crash on invalid index names
+        https://bugs.webkit.org/show_bug.cgi?id=46362
+
+        * storage/indexeddb/objectstore-basics-expected.txt:
+        * storage/indexeddb/objectstore-basics.html:
+
 2010-09-22  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index 821e966..9a91cdf 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -50,6 +50,10 @@ PASS store.name is "storeName"
 PASS store.keyPath is null
 PASS storeNames.contains('storeName') is true
 PASS storeNames.length is 1
+Ask for a store that doesn't exist:
+index = store.index('asdf')
+PASS index is null
+FAIL Asking for a store that doesn't exist should have thrown.
 event.result.createIndex('indexName', 'x', true)
 PASS 'onsuccess' in result is true
 PASS 'onerror' in result is true
@@ -70,7 +74,14 @@ PASS 'abort' in event.target is true
 PASS 'readyState' in event.target is true
 PASS event.target.readyState is event.target.DONE
 
+PASS event.result !== null is true
 PASS event.source.indexNames.contains('indexName') is true
+index = event.source.index('indexName')
+PASS index !== null is true
+Ask for a store that doesn't exist:
+index = store.index('asdf')
+PASS index is null
+FAIL Asking for a store that doesn't exist should have thrown.
 event.source.add({x: 'value'}, 'key')
 PASS 'onsuccess' in result is true
 PASS 'onerror' in result is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 66376b7..b2d383a 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -49,6 +49,16 @@ function createSuccess()
     shouldBe("storeNames.length", "1");
     // FIXME: test all of object store's methods.
 
+    debug("Ask for a store that doesn't exist:");
+    try {
+        index = evalAndLog("index = store.index('asdf')");
+        shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object!
+        testFailed("Asking for a store that doesn't exist should have thrown.");
+    } catch (err) {
+        testPassed("Error thrown.");
+        // FIXME: Verify the correct exception thrown.
+    }
+
     result = evalAndLog("event.result.createIndex('indexName', 'x', true)"); // true == unique requirement.
     verifyResult(result);
     result.onsuccess = addIndexSuccess;
@@ -59,7 +69,20 @@ function addIndexSuccess()
 {
     debug("addIndexSuccess():");
     verifySuccessEvent(event);
+    shouldBeTrue("event.result !== null");
     shouldBeTrue("event.source.indexNames.contains('indexName')");
+    index = evalAndLog("index = event.source.index('indexName')");
+    shouldBeTrue("index !== null");
+
+    debug("Ask for a store that doesn't exist:");
+    try {
+        index = evalAndLog("index = store.index('asdf')");
+        shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object!
+        testFailed("Asking for a store that doesn't exist should have thrown.");
+    } catch (err) {
+        testPassed("Error thrown.");
+        // FIXME: Verify the correct exception thrown.
+    }
 
     result = evalAndLog("event.source.add({x: 'value'}, 'key')");
     verifyResult(result);
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3ee4e1c..9a39267 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-23  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        IndexedDB shouldn't crash on invalid index names
+        https://bugs.webkit.org/show_bug.cgi?id=46362
+
+        For now, return null.  In a later patch, we'll do proper exception raising.
+
+        * storage/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::index):
+
 2010-09-23  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by Dave Hyatt.
diff --git a/WebCore/storage/IDBObjectStore.cpp b/WebCore/storage/IDBObjectStore.cpp
index 768b93c..4c5cf34 100644
--- a/WebCore/storage/IDBObjectStore.cpp
+++ b/WebCore/storage/IDBObjectStore.cpp
@@ -99,8 +99,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::createIndex(ScriptExecutionContext* conte
 
 PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name)
 {
+    // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
     RefPtr<IDBIndexBackendInterface> index = m_objectStore->index(name);
-    ASSERT(index); // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
+    if (!index)
+        return 0;
     return IDBIndex::create(index.release());
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list