#include "components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_transaction.h"
#include <stddef.h>
#include <algorithm>
#include <cstring>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "components/services/storage/indexed_db/locks/partitioned_lock_manager.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scope.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scopes.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scopes_test_utils.h"
#include "components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.h"
#include "components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_factory.h"
#include "components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_iterator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/comparator.h"
namespace content {
namespace {
const size_t kTestingMaxOpenCursors = …;
}
class TransactionalLevelDBTransactionTest : public LevelDBScopesTestBase { … };
TEST_F(TransactionalLevelDBTransactionTest, GetPutDelete) { … }
TEST_F(TransactionalLevelDBTransactionTest, Iterator) { … }
TEST_F(TransactionalLevelDBTransactionTest, Commit) { … }
TEST_F(TransactionalLevelDBTransactionTest, IterationWithEvictedCursors) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorReloadingNext) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorReloadingPrev) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorSkipsScopesMetadata) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorReflectsInitialChanges) { … }
namespace {
enum RangePrepareMode { … };
}
class LevelDBTransactionRangeTest
: public TransactionalLevelDBTransactionTest,
public testing::WithParamInterface<RangePrepareMode> { … };
TEST_P(LevelDBTransactionRangeTest, RemoveRangeUpperClosed) { … }
TEST_P(LevelDBTransactionRangeTest, RemoveRangeUpperOpen) { … }
TEST_P(LevelDBTransactionRangeTest, RemoveRangeIteratorRetainsKey) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(TransactionalLevelDBTransactionTest, IteratorValueStaysTheSame) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorPutInvalidation) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorRemoveInvalidation) { … }
TEST_F(TransactionalLevelDBTransactionTest, IteratorGoesInvalidAfterRemove) { … }
TEST_F(TransactionalLevelDBTransactionTest,
IteratorNextAfterRemovingCurrentKey) { … }
TEST_F(TransactionalLevelDBTransactionTest,
IteratorPrevAfterRemovingCurrentKeyAtDatabaseEnd) { … }
TEST_F(TransactionalLevelDBTransactionTest,
IteratorPrevAfterRemovingCurrentKeyAtDatabaseStart) { … }
}