Changeset 124974 in webkit


Ignore:
Timestamp:
Aug 7, 2012, 8:06:22 PM (13 years ago)
Author:
jsbell@chromium.org
Message:

Layout Test storage/indexeddb/intversion-omit-parameter.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=92952

Reviewed by Tony Chang.

Source/WebCore:

Account for events being propagated from the back-end to front-end after
front-end context is stopped (i.e. document is being destroyed). The IDBRequest
lifecycle was tightened up in http://trac.webkit.org/changeset/123275 with more
asserts but the stopped state wasn't accounted for.

Test: [chromium] webkit_unit_tests --gtest_filter='IDBRequestTest.EventsAfterStopping'

  • Modules/indexeddb/IDBRequest.cpp:

(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::onError):
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::onSuccessWithContinuation):

Source/WebKit/chromium:

Added test to exercise WebCore::IDBRequest event callbacks after
the script context has stopped and ensure no asserts are hit.

  • WebKit.gypi:
  • tests/IDBRequestTest.cpp: Added.

(WebCore):
(WebCore::TEST):

LayoutTests:

Remove expectation now that flakiness should be resolved.

  • platform/chromium/TestExpectations:
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124960 r124974  
     12012-08-07  Joshua Bell  <jsbell@chromium.org>
     2
     3        Layout Test storage/indexeddb/intversion-omit-parameter.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=92952
     5
     6        Reviewed by Tony Chang.
     7
     8        Remove expectation now that flakiness should be resolved.
     9
     10        * platform/chromium/TestExpectations:
     11
    1122012-08-07  Yoshifumi Inoue  <yosin@chromium.org>
    213
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r124907 r124974  
    34623462BUGWK92941 WIN MAC : accessibility/loading-iframe-updates-axtree.html = CRASH PASS
    34633463
    3464 // Flakily crashing after http://trac.webkit.org/changeset/124402
    3465 BUGWK92952 DEBUG : storage/indexeddb/intversion-omit-parameter.html = CRASH PASS
    3466 
    34673464// Tests added by bug 76270. According to bug 92968, they should be skipped in Chromium.
    34683465BUGWK92968 SKIP : http/tests/appcache/abort-cache-onchecking-manifest-404.html = PASS
  • trunk/Source/WebCore/ChangeLog

    r124972 r124974  
     12012-08-07  Joshua Bell  <jsbell@chromium.org>
     2
     3        Layout Test storage/indexeddb/intversion-omit-parameter.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=92952
     5
     6        Reviewed by Tony Chang.
     7
     8        Account for events being propagated from the back-end to front-end after
     9        front-end context is stopped (i.e. document is being destroyed). The IDBRequest
     10        lifecycle was tightened up in http://trac.webkit.org/changeset/123275 with more
     11        asserts but the stopped state wasn't accounted for.
     12
     13        Test: [chromium] webkit_unit_tests --gtest_filter='IDBRequestTest.EventsAfterStopping'
     14
     15        * Modules/indexeddb/IDBRequest.cpp:
     16        (WebCore::IDBRequest::abort):
     17        (WebCore::IDBRequest::onError):
     18        (WebCore::IDBRequest::onSuccess):
     19        (WebCore::IDBRequest::onSuccessWithContinuation):
     20
    1212012-08-07  Kentaro Hara  <haraken@chromium.org>
    222
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp

    r124842 r124974  
    142142void IDBRequest::abort()
    143143{
    144     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    145144    ASSERT(!m_requestAborted);
    146145    if (m_contextStopped || !scriptExecutionContext())
    147146        return;
     147    ASSERT(m_readyState == PENDING || m_readyState == DONE);
    148148    if (m_readyState == DONE)
    149149        return;
     
    211211}
    212212
    213 void IDBRequest::onError(PassRefPtr<IDBDatabaseError> error)
    214 {
     213bool IDBRequest::shouldEnqueueEvent() const
     214{
     215    if (m_contextStopped || !scriptExecutionContext())
     216        return false;
    215217    ASSERT(m_readyState == PENDING || m_readyState == DONE);
    216218    if (m_requestAborted)
    217         return;
     219        return false;
    218220    ASSERT(m_readyState == PENDING);
    219221    ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     222    return true;
     223}
     224
     225void IDBRequest::onError(PassRefPtr<IDBDatabaseError> error)
     226{
     227    IDB_TRACE("IDBRequest::onError()");
     228    if (!shouldEnqueueEvent())
     229        return;
     230
    220231    m_errorCode = error->code();
    221232    m_errorMessage = error->message();
     
    233244{
    234245    IDB_TRACE("IDBRequest::onSuccess(DOMStringList)");
    235     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    236     if (m_requestAborted)
    237         return;
    238     ASSERT(m_readyState == PENDING);
    239     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     246    if (!shouldEnqueueEvent())
     247        return;
     248
    240249    m_result = IDBAny::create(domStringList);
    241250    enqueueEvent(createSuccessEvent());
     
    245254{
    246255    IDB_TRACE("IDBRequest::onSuccess(IDBCursor)");
    247     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    248     if (m_requestAborted)
    249         return;
    250     ASSERT(m_readyState == PENDING);
    251     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     256    if (!shouldEnqueueEvent())
     257        return;
     258
    252259    ASSERT(m_cursorType != IDBCursorBackendInterface::InvalidCursorType);
    253260    RefPtr<IDBCursor> cursor;
     
    264271{
    265272    IDB_TRACE("IDBRequest::onSuccess(IDBDatabase)");
    266     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    267     if (m_requestAborted)
    268         return;
    269     ASSERT(m_readyState == PENDING);
    270     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
    271     if (m_contextStopped || !scriptExecutionContext())
     273    if (!shouldEnqueueEvent())
    272274        return;
    273275
     
    282284{
    283285    IDB_TRACE("IDBRequest::onSuccess(IDBKey)");
    284     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    285     if (m_requestAborted)
    286         return;
    287     ASSERT(m_readyState == PENDING);
    288     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     286    if (!shouldEnqueueEvent())
     287        return;
     288
    289289    if (idbKey && idbKey->isValid())
    290290        m_result = IDBAny::create(idbKey);
     
    297297{
    298298    IDB_TRACE("IDBRequest::onSuccess(IDBTransaction)");
    299     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    300     if (m_requestAborted)
    301         return;
    302     ASSERT(m_readyState == PENDING);
    303     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
    304299    RefPtr<IDBTransactionBackendInterface> backend = prpBackend;
    305300
    306301    if (m_contextStopped || !scriptExecutionContext()) {
    307         backend->abort();
    308         return;
    309     }
     302        // Should only be null in tests.
     303        if (backend.get())
     304            backend->abort();
     305        return;
     306    }
     307    if (!shouldEnqueueEvent())
     308        return;
    310309
    311310    RefPtr<IDBTransaction> frontend = IDBTransaction::create(scriptExecutionContext(), backend, IDBTransaction::VERSION_CHANGE, m_source->idbDatabase().get());
     
    323322{
    324323    IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue)");
    325     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    326     if (m_requestAborted)
    327         return;
    328     ASSERT(m_readyState == PENDING);
    329     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     324    if (!shouldEnqueueEvent())
     325        return;
     326
    330327    m_result = IDBAny::create(serializedScriptValue);
    331328    m_pendingCursor.clear();
     
    348345void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> prpSerializedScriptValue, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
    349346{
    350     if (m_requestAborted)
    351         return;
     347    IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue, IDBKey, IDBKeyPath)");
     348    if (!shouldEnqueueEvent())
     349        return;
     350
    352351#ifndef NDEBUG
    353352    ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath());
     
    374373{
    375374    IDB_TRACE("IDBRequest::onSuccessWithContinuation");
    376     ASSERT(m_readyState == PENDING || m_readyState == DONE);
    377     if (m_requestAborted)
    378         return;
    379     ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
     375    if (!shouldEnqueueEvent())
     376        return;
     377
    380378    ASSERT(m_pendingCursor);
    381379    setResultCursor(m_pendingCursor.release());
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h

    r124842 r124974  
    115115
    116116private:
     117    bool shouldEnqueueEvent() const;
     118
    117119    // EventTarget
    118120    virtual void refEventTarget() { ref(); }
  • trunk/Source/WebKit/chromium/ChangeLog

    r124954 r124974  
     12012-08-07  Joshua Bell  <jsbell@chromium.org>
     2
     3        Layout Test storage/indexeddb/intversion-omit-parameter.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=92952
     5
     6        Reviewed by Tony Chang.
     7
     8        Added test to exercise WebCore::IDBRequest event callbacks after
     9        the script context has stopped and ensure no asserts are hit.
     10
     11        * WebKit.gypi:
     12        * tests/IDBRequestTest.cpp: Added.
     13        (WebCore):
     14        (WebCore::TEST):
     15
    1162012-08-07  Fady Samuel  <fsamuel@chromium.org>
    217
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r124839 r124974  
    119119            'tests/IDBKeyPathTest.cpp',
    120120            'tests/IDBLevelDBCodingTest.cpp',
     121            'tests/IDBRequestTest.cpp',
    121122            'tests/ImageLayerChromiumTest.cpp',
    122123            'tests/KeyboardTest.cpp',
Note: See TracChangeset for help on using the changeset viewer.