Changeset 147381 in webkit


Ignore:
Timestamp:
Apr 1, 2013 10:29:39 PM (11 years ago)
Author:
jsbell@chromium.org
Message:

[Chromium] IndexedDB: Turn "should only be true in unit tests" comments into ASSERTs
https://bugs.webkit.org/show_bug.cgi?id=113597

Reviewed by Adam Barth.

In the vein of wkbug.com/111233 and wkbug.com/110820 don't just comment that
some condition is true only in unit tests - ASSERT that Chromium's unitTestSupport()
is non-null to catch errors during development.

Exercised by Chromium's webkit_unit_tests.

  • Modules/indexeddb/IDBDatabaseBackendImpl.cpp:

(WebCore::IDBDatabaseBackendImpl::openConnection):
(WebCore::IDBDatabaseBackendImpl::close):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147375 r147381  
     12013-04-01  Joshua Bell  <jsbell@chromium.org>
     2
     3        [Chromium] IndexedDB: Turn "should only be true in unit tests" comments into ASSERTs
     4        https://bugs.webkit.org/show_bug.cgi?id=113597
     5
     6        Reviewed by Adam Barth.
     7
     8        In the vein of wkbug.com/111233 and wkbug.com/110820 don't just comment that
     9        some condition is true only in unit tests - ASSERT that Chromium's unitTestSupport()
     10        is non-null to catch errors during development.
     11
     12        Exercised by Chromium's webkit_unit_tests.
     13
     14        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
     15        (WebCore::IDBDatabaseBackendImpl::openConnection):
     16        (WebCore::IDBDatabaseBackendImpl::close):
     17
    1182013-04-01  Roger Fong  <roger_fong@apple.com>
    219
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp

    r147244 r147381  
    3939#include "IDBTransactionCoordinator.h"
    4040#include "SharedBuffer.h"
     41#if PLATFORM(CHROMIUM)
     42#include <public/Platform.h>
     43#endif
    4144#include <wtf/TemporaryChange.h>
    4245
     
    12131216    if (version == IDBDatabaseMetadata::DefaultIntVersion) {
    12141217        // For unit tests only - skip upgrade steps. Calling from script with DefaultIntVersion throws exception.
     1218#if PLATFORM(CHROMIUM)
     1219        ASSERT(WebKit::Platform::current()->unitTestSupport());
     1220#endif
    12151221        ASSERT(isNewDatabase);
    12161222        m_databaseCallbacksSet.add(databaseCallbacks);
     
    13491355
    13501356        m_backingStore.clear();
    1351         // This check should only be false in tests.
     1357
     1358        // This check should only be false in unit tests.
     1359#if PLATFORM(CHROMIUM)
     1360        ASSERT(m_factory || WebKit::Platform::current()->unitTestSupport());
     1361#else
     1362        ASSERT(m_factory);
     1363#endif
    13521364        if (m_factory)
    13531365            m_factory->removeIDBDatabaseBackend(m_identifier);
Note: See TracChangeset for help on using the changeset viewer.