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

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: Removed a bit of extra blob_info stuff that leaked in. 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..11b48c7674e2b00ffa92e0ed2a3b4e13d7748389 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,9 +26,9 @@ 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"));
@@ -40,9 +41,8 @@ class IndexedDBBackingStoreTest : public testing::Test {
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;
cmumford 2014/03/14 00:36:16 is m_key3 still needed? Not sure why value3 went a
ericu 2014/03/14 01:17:23 Nope; neither's used in current code. Removed.
private:
DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest);
@@ -62,12 +62,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 +119,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 +159,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();

Powered by Google App Engine
This is Rietveld 408576698