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

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

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: memory leak fixed Created 5 years, 11 months 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 <set> 7 #include <set>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 db_->CreateObjectStore(transaction_->id(), 383 db_->CreateObjectStore(transaction_->id(),
384 store_id, 384 store_id,
385 ASCIIToUTF16("store"), 385 ASCIIToUTF16("store"),
386 IndexedDBKeyPath(), 386 IndexedDBKeyPath(),
387 false /*auto_increment*/); 387 false /*auto_increment*/);
388 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); 388 EXPECT_EQ(1ULL, db_->metadata().object_stores.size());
389 389
390 390
391 // Put is asynchronous 391 // Put is asynchronous
392 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); 392 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>());
393 ScopedVector<storage::BlobDataHandle> handles; 393 ScopedVector<storage::BlobDataSnapshotHandle> handles;
394 scoped_ptr<IndexedDBKey> key(new IndexedDBKey("key")); 394 scoped_ptr<IndexedDBKey> key(new IndexedDBKey("key"));
395 std::vector<IndexedDBDatabase::IndexKeys> index_keys; 395 std::vector<IndexedDBDatabase::IndexKeys> index_keys;
396 scoped_refptr<MockIndexedDBCallbacks> request( 396 scoped_refptr<MockIndexedDBCallbacks> request(
397 new MockIndexedDBCallbacks(false)); 397 new MockIndexedDBCallbacks(false));
398 db_->Put(transaction_->id(), 398 db_->Put(transaction_->id(),
399 store_id, 399 store_id,
400 &value, 400 &value,
401 &handles, 401 &handles,
402 key.Pass(), 402 key.Pass(),
403 blink::WebIDBPutModeAddOnly, 403 blink::WebIDBPutModeAddOnly,
404 request, 404 request,
405 index_keys); 405 index_keys);
406 406
407 // Deletion is asynchronous. 407 // Deletion is asynchronous.
408 db_->DeleteObjectStore(transaction_->id(), 408 db_->DeleteObjectStore(transaction_->id(),
409 store_id); 409 store_id);
410 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); 410 EXPECT_EQ(1ULL, db_->metadata().object_stores.size());
411 411
412 // This will execute the Put then Delete. 412 // This will execute the Put then Delete.
413 RunPostedTasks(); 413 RunPostedTasks();
414 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); 414 EXPECT_EQ(0ULL, db_->metadata().object_stores.size());
415 415
416 transaction_->Commit(); // Cleans up the object hierarchy. 416 transaction_->Commit(); // Cleans up the object hierarchy.
417 } 417 }
418 418
419 } // namespace content 419 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698