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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" | 10 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 ok = backing_store_->GetPrimaryKeyViaIndex(&transaction1, | 229 ok = backing_store_->GetPrimaryKeyViaIndex(&transaction1, |
230 database_id, | 230 database_id, |
231 KeyPrefix::kInvalidId, | 231 KeyPrefix::kInvalidId, |
232 index_id, | 232 index_id, |
233 m_key1, | 233 m_key1, |
234 &new_primary_key); | 234 &new_primary_key); |
235 EXPECT_FALSE(ok); | 235 EXPECT_FALSE(ok); |
236 } | 236 } |
237 | 237 |
238 TEST_F(IndexedDBBackingStoreTest, CreateDatabase) { | 238 TEST_F(IndexedDBBackingStoreTest, CreateDatabase) { |
239 const string16 database_name(ASCIIToUTF16("db1")); | 239 const base::string16 database_name(ASCIIToUTF16("db1")); |
240 int64 database_id; | 240 int64 database_id; |
241 const string16 version(ASCIIToUTF16("old_string_version")); | 241 const base::string16 version(ASCIIToUTF16("old_string_version")); |
242 const int64 int_version = 9; | 242 const int64 int_version = 9; |
243 | 243 |
244 const int64 object_store_id = 99; | 244 const int64 object_store_id = 99; |
245 const string16 object_store_name(ASCIIToUTF16("object_store1")); | 245 const base::string16 object_store_name(ASCIIToUTF16("object_store1")); |
246 const bool auto_increment = true; | 246 const bool auto_increment = true; |
247 const IndexedDBKeyPath object_store_key_path( | 247 const IndexedDBKeyPath object_store_key_path( |
248 ASCIIToUTF16("object_store_key")); | 248 ASCIIToUTF16("object_store_key")); |
249 | 249 |
250 const int64 index_id = 999; | 250 const int64 index_id = 999; |
251 const string16 index_name(ASCIIToUTF16("index1")); | 251 const base::string16 index_name(ASCIIToUTF16("index1")); |
252 const bool unique = true; | 252 const bool unique = true; |
253 const bool multi_entry = true; | 253 const bool multi_entry = true; |
254 const IndexedDBKeyPath index_key_path(ASCIIToUTF16("index_key")); | 254 const IndexedDBKeyPath index_key_path(ASCIIToUTF16("index_key")); |
255 | 255 |
256 { | 256 { |
257 bool ok = backing_store_->CreateIDBDatabaseMetaData( | 257 bool ok = backing_store_->CreateIDBDatabaseMetaData( |
258 database_name, version, int_version, &database_id); | 258 database_name, version, int_version, &database_id); |
259 EXPECT_TRUE(ok); | 259 EXPECT_TRUE(ok); |
260 EXPECT_GT(database_id, 0); | 260 EXPECT_GT(database_id, 0); |
261 | 261 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 EXPECT_EQ(index_name, index.name); | 312 EXPECT_EQ(index_name, index.name); |
313 EXPECT_EQ(index_key_path, index.key_path); | 313 EXPECT_EQ(index_key_path, index.key_path); |
314 EXPECT_EQ(unique, index.unique); | 314 EXPECT_EQ(unique, index.unique); |
315 EXPECT_EQ(multi_entry, index.multi_entry); | 315 EXPECT_EQ(multi_entry, index.multi_entry); |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 } // namespace | 319 } // namespace |
320 | 320 |
321 } // namespace content | 321 } // namespace content |
OLD | NEW |