OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_database.h" | 5 #include "content/browser/indexed_db/indexed_db_database.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 db_->CreateObjectStore(transaction_->id(), | 390 db_->CreateObjectStore(transaction_->id(), |
391 store_id, | 391 store_id, |
392 ASCIIToUTF16("store"), | 392 ASCIIToUTF16("store"), |
393 IndexedDBKeyPath(), | 393 IndexedDBKeyPath(), |
394 false /*auto_increment*/); | 394 false /*auto_increment*/); |
395 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 395 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
396 | 396 |
397 | 397 |
398 // Put is asynchronous | 398 // Put is asynchronous |
399 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); | 399 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); |
400 ScopedVector<storage::BlobDataHandle> handles; | 400 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles; |
401 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key")); | 401 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key")); |
402 std::vector<IndexedDBDatabase::IndexKeys> index_keys; | 402 std::vector<IndexedDBDatabase::IndexKeys> index_keys; |
403 scoped_refptr<MockIndexedDBCallbacks> request( | 403 scoped_refptr<MockIndexedDBCallbacks> request( |
404 new MockIndexedDBCallbacks(false)); | 404 new MockIndexedDBCallbacks(false)); |
405 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key), | 405 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key), |
406 blink::WebIDBPutModeAddOnly, request, index_keys); | 406 blink::WebIDBPutModeAddOnly, request, index_keys); |
407 | 407 |
408 // Deletion is asynchronous. | 408 // Deletion is asynchronous. |
409 db_->DeleteObjectStore(transaction_->id(), | 409 db_->DeleteObjectStore(transaction_->id(), |
410 store_id); | 410 store_id); |
411 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 411 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
412 | 412 |
413 // This will execute the Put then Delete. | 413 // This will execute the Put then Delete. |
414 RunPostedTasks(); | 414 RunPostedTasks(); |
415 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); | 415 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); |
416 | 416 |
417 transaction_->Commit(); // Cleans up the object hierarchy. | 417 transaction_->Commit(); // Cleans up the object hierarchy. |
418 } | 418 } |
419 | 419 |
420 } // namespace content | 420 } // namespace content |
OLD | NEW |