Skip to content
  • jsbell@chromium.org's avatar
    IndexedDB: Closing connection in upgradeneeded should result in error event · fdeaab3e
    jsbell@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=99486
    
    Reviewed by Tony Chang.
    
    Source/WebCore:
    
    The IDB spec requires that "...if connection is closed, return a DOMError of type AbortError".
    This was being handled during the "enqueue" phase, which was too early either for synchronously
    executing scripts or asynchronous messaging in multiprocess ports (crbug.com/150691). Move the
    logic to the "dispatch" phase.
    
    Test: storage/indexeddb/intversion-close-in-oncomplete.html
    
    * Modules/indexeddb/IDBOpenDBRequest.cpp:
    (WebCore::IDBOpenDBRequest::onSuccess): Move success to error morphing from here...
    (WebCore::IDBOpenDBRequest::dispatchEvent): To here.
    * Modules/indexeddb/IDBOpenDBRequest.h:
    (IDBOpenDBRequest):
    
    LayoutTests:
    
    Updated test expectation - error, not success.
    
    * storage/indexeddb/intversion-close-in-oncomplete-expected.txt:
    * storage/indexeddb/resources/intversion-close-in-oncomplete.js:
    (deleteSuccess):
    (upgradeNeeded.transaction.oncomplete):
    (upgradeNeeded):
    (openError):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    fdeaab3e