| Index: content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc
|
| diff --git a/content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc b/content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc
|
| index d4870f13cf4c56f5081aeca29512b1b8d59c6f30..3428346eaed45e17234127588757f3afed4c8c87 100644
|
| --- a/content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc
|
| +++ b/content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc
|
| @@ -106,6 +106,10 @@ class LevelDBTransactionTest : public testing::Test {
|
| return new LevelDBTransaction(db());
|
| }
|
|
|
| + static constexpr size_t SizeOfRecord() {
|
| + return sizeof(LevelDBTransaction::Record);
|
| + }
|
| +
|
| private:
|
| base::ScopedTempDir temp_directory_;
|
| SimpleComparator comparator_;
|
| @@ -114,7 +118,7 @@ class LevelDBTransactionTest : public testing::Test {
|
| DISALLOW_COPY_AND_ASSIGN(LevelDBTransactionTest);
|
| };
|
|
|
| -TEST_F(LevelDBTransactionTest, GetAndPut) {
|
| +TEST_F(LevelDBTransactionTest, GetPutDelete) {
|
| leveldb::Status status;
|
|
|
| const std::string key("key");
|
| @@ -150,12 +154,19 @@ TEST_F(LevelDBTransactionTest, GetAndPut) {
|
|
|
| const std::string another_key("another key");
|
| const std::string another_value("another value");
|
| + EXPECT_EQ(0ull, transaction->GetTransactionSize());
|
| TransactionPut(transaction.get(), another_key, another_value);
|
| + EXPECT_EQ(SizeOfRecord() + another_key.size() * 2 + another_value.size(),
|
| + transaction->GetTransactionSize());
|
|
|
| status = transaction->Get(another_key, &got_value, &found);
|
| EXPECT_TRUE(status.ok());
|
| EXPECT_TRUE(found);
|
| EXPECT_EQ(Compare(got_value, another_value), 0);
|
| +
|
| + transaction->Remove(another_key);
|
| + EXPECT_EQ(SizeOfRecord() + another_key.size() * 2,
|
| + transaction->GetTransactionSize());
|
| }
|
|
|
| TEST_F(LevelDBTransactionTest, Iterator) {
|
|
|