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

Side by Side Diff: content/browser/indexed_db/indexed_db_database_unittest.cc

Issue 2449953008: Port messages sent by WebIDBDatabaseImpl to Mojo. (Closed)
Patch Set: Address more comments from dcheng@. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.cc ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698