| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // and object_store_id still work. | 83 // and object_store_id still work. |
| 84 TEST_F(IndexedDBBackingStoreTest, HighIds) { | 84 TEST_F(IndexedDBBackingStoreTest, HighIds) { |
| 85 const int64 high_database_id = 1ULL << 35; | 85 const int64 high_database_id = 1ULL << 35; |
| 86 const int64 high_object_store_id = 1ULL << 39; | 86 const int64 high_object_store_id = 1ULL << 39; |
| 87 // index_ids are capped at 32 bits for storage purposes. | 87 // index_ids are capped at 32 bits for storage purposes. |
| 88 const int64 high_index_id = 1ULL << 29; | 88 const int64 high_index_id = 1ULL << 29; |
| 89 | 89 |
| 90 const int64 invalid_high_index_id = 1ULL << 37; | 90 const int64 invalid_high_index_id = 1ULL << 37; |
| 91 | 91 |
| 92 const IndexedDBKey& index_key = m_key2; | 92 const IndexedDBKey& index_key = m_key2; |
| 93 std::vector<char> index_key_raw = EncodeIDBKey(index_key); | 93 std::vector<char> index_key_raw; |
| 94 EncodeIDBKey(index_key, &index_key_raw); |
| 94 { | 95 { |
| 95 IndexedDBBackingStore::Transaction transaction1(backing_store_.get()); | 96 IndexedDBBackingStore::Transaction transaction1(backing_store_.get()); |
| 96 transaction1.begin(); | 97 transaction1.begin(); |
| 97 IndexedDBBackingStore::RecordIdentifier record; | 98 IndexedDBBackingStore::RecordIdentifier record; |
| 98 bool ok = backing_store_->PutRecord(&transaction1, | 99 bool ok = backing_store_->PutRecord(&transaction1, |
| 99 high_database_id, | 100 high_database_id, |
| 100 high_object_store_id, | 101 high_object_store_id, |
| 101 m_key1, | 102 m_key1, |
| 102 m_value1, | 103 m_value1, |
| 103 &record); | 104 &record); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 EXPECT_FALSE(mem_store2->HasOneRef()); // mem_store1 and 2 | 398 EXPECT_FALSE(mem_store2->HasOneRef()); // mem_store1 and 2 |
| 398 EXPECT_TRUE(mem_store3->HasOneRef()); | 399 EXPECT_TRUE(mem_store3->HasOneRef()); |
| 399 | 400 |
| 400 mem_store2 = NULL; | 401 mem_store2 = NULL; |
| 401 EXPECT_TRUE(mem_store1->HasOneRef()); | 402 EXPECT_TRUE(mem_store1->HasOneRef()); |
| 402 } | 403 } |
| 403 | 404 |
| 404 } // namespace | 405 } // namespace |
| 405 | 406 |
| 406 } // namespace content | 407 } // namespace content |
| OLD | NEW |