Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: content/browser/indexed_db/indexed_db_backing_store_unittest.cc

Issue 197753011: Add IndexedDBValue wrapper class to group blob info with bits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet still happier clang, I hope. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_backing_store_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
index e45501a9409ad5c7cfaf84d895f6f937a735dc89..4d6beb30c4abcd740e99677aa3176b2226ec91bf 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -8,6 +8,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
+#include "content/browser/indexed_db/indexed_db_value.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebIDBTypes.h"
@@ -25,12 +26,11 @@ class IndexedDBBackingStoreTest : public testing::Test {
backing_store_ = IndexedDBBackingStore::OpenInMemory(origin);
// useful keys and values during tests
- m_value1 = "value1";
- m_value2 = "value2";
- m_value3 = "value3";
+ m_value1 = IndexedDBValue("value1", std::vector<IndexedDBBlobInfo>());
+ m_value2 = IndexedDBValue("value2", std::vector<IndexedDBBlobInfo>());
+
m_key1 = IndexedDBKey(99, blink::WebIDBKeyTypeNumber);
m_key2 = IndexedDBKey(ASCIIToUTF16("key2"));
- m_key3 = IndexedDBKey(ASCIIToUTF16("key3"));
}
protected:
@@ -39,10 +39,8 @@ class IndexedDBBackingStoreTest : public testing::Test {
// Sample keys and values that are consistent.
IndexedDBKey m_key1;
IndexedDBKey m_key2;
- IndexedDBKey m_key3;
- std::string m_value1;
- std::string m_value2;
- std::string m_value3;
+ IndexedDBValue m_value1;
+ IndexedDBValue m_value2;
private:
DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest);
@@ -62,12 +60,12 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistency) {
{
IndexedDBBackingStore::Transaction transaction2(backing_store_);
transaction2.Begin();
- std::string result_value;
+ IndexedDBValue result_value;
leveldb::Status s =
backing_store_->GetRecord(&transaction2, 1, 1, m_key1, &result_value);
transaction2.Commit();
EXPECT_TRUE(s.ok());
- EXPECT_EQ(m_value1, result_value);
+ EXPECT_EQ(m_value1.bits, result_value.bits);
}
}
@@ -119,14 +117,14 @@ TEST_F(IndexedDBBackingStoreTest, HighIds) {
{
IndexedDBBackingStore::Transaction transaction2(backing_store_);
transaction2.Begin();
- std::string result_value;
+ IndexedDBValue result_value;
leveldb::Status s = backing_store_->GetRecord(&transaction2,
high_database_id,
high_object_store_id,
m_key1,
&result_value);
EXPECT_TRUE(s.ok());
- EXPECT_EQ(m_value1, result_value);
+ EXPECT_EQ(m_value1.bits, result_value.bits);
scoped_ptr<IndexedDBKey> new_primary_key;
s = backing_store_->GetPrimaryKeyViaIndex(&transaction2,
@@ -159,7 +157,7 @@ TEST_F(IndexedDBBackingStoreTest, InvalidIds) {
const int64 index_id = kMinimumIndexId;
const int64 invalid_low_index_id = 19; // index_ids must be > kMinimumIndexId
- std::string result_value;
+ IndexedDBValue result_value;
IndexedDBBackingStore::Transaction transaction1(backing_store_);
transaction1.Begin();
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.cc ('k') | content/browser/indexed_db/indexed_db_blob_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698