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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 ASCIIToUTF16("store"), | 504 ASCIIToUTF16("store"), |
505 IndexedDBKeyPath(), | 505 IndexedDBKeyPath(), |
506 false /*auto_increment*/); | 506 false /*auto_increment*/); |
507 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 507 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
508 | 508 |
509 | 509 |
510 // Put is asynchronous | 510 // Put is asynchronous |
511 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); | 511 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); |
512 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles; | 512 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles; |
513 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key")); | 513 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key")); |
514 std::vector<IndexedDBDatabase::IndexKeys> index_keys; | 514 std::vector<IndexedDBIndexKeys> index_keys; |
515 scoped_refptr<MockIndexedDBCallbacks> request( | 515 scoped_refptr<MockIndexedDBCallbacks> request( |
516 new MockIndexedDBCallbacks(false)); | 516 new MockIndexedDBCallbacks(false)); |
517 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key), | 517 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key), |
518 blink::WebIDBPutModeAddOnly, request, index_keys); | 518 blink::WebIDBPutModeAddOnly, request, index_keys); |
519 | 519 |
520 // Deletion is asynchronous. | 520 // Deletion is asynchronous. |
521 db_->DeleteObjectStore(transaction_->id(), | 521 db_->DeleteObjectStore(transaction_->id(), |
522 store_id); | 522 store_id); |
523 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 523 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
524 | 524 |
525 // This will execute the Put then Delete. | 525 // This will execute the Put then Delete. |
526 RunPostedTasks(); | 526 RunPostedTasks(); |
527 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); | 527 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); |
528 | 528 |
529 transaction_->Commit(); // Cleans up the object hierarchy. | 529 transaction_->Commit(); // Cleans up the object hierarchy. |
530 } | 530 } |
531 | 531 |
532 } // namespace content | 532 } // namespace content |
OLD | NEW |