| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 static const int64_t kDatabaseId0 = 7; | 100 static const int64_t kDatabaseId0 = 7; |
| 101 static const int64_t kDatabaseId1 = 12; | 101 static const int64_t kDatabaseId1 = 12; |
| 102 static const int64_t kBlobKey0 = 77; | 102 static const int64_t kBlobKey0 = 77; |
| 103 static const int64_t kBlobKey1 = 14; | 103 static const int64_t kBlobKey1 = 14; |
| 104 | 104 |
| 105 IndexedDBActiveBlobRegistryTest() | 105 IndexedDBActiveBlobRegistryTest() |
| 106 : task_runner_(new base::TestSimpleTaskRunner), | 106 : task_runner_(new base::TestSimpleTaskRunner), |
| 107 factory_(new RegistryTestMockFactory), | 107 factory_(new RegistryTestMockFactory), |
| 108 backing_store_( | 108 backing_store_( |
| 109 new MockIDBBackingStore(factory_.get(), task_runner_.get())), | 109 new MockIDBBackingStore(factory_.get(), task_runner_.get())), |
| 110 registry_(new IndexedDBActiveBlobRegistry(backing_store_.get())) {} | 110 registry_(base::MakeUnique<IndexedDBActiveBlobRegistry>( |
| 111 backing_store_.get())) {} |
| 111 | 112 |
| 112 void RunUntilIdle() { task_runner_->RunUntilIdle(); } | 113 void RunUntilIdle() { task_runner_->RunUntilIdle(); } |
| 113 RegistryTestMockFactory* factory() const { return factory_.get(); } | 114 RegistryTestMockFactory* factory() const { return factory_.get(); } |
| 114 MockIDBBackingStore* backing_store() const { return backing_store_.get(); } | 115 MockIDBBackingStore* backing_store() const { return backing_store_.get(); } |
| 115 IndexedDBActiveBlobRegistry* registry() const { return registry_.get(); } | 116 IndexedDBActiveBlobRegistry* registry() const { return registry_.get(); } |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; | 119 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; |
| 119 scoped_refptr<RegistryTestMockFactory> factory_; | 120 scoped_refptr<RegistryTestMockFactory> factory_; |
| 120 scoped_refptr<MockIDBBackingStore> backing_store_; | 121 scoped_refptr<MockIDBBackingStore> backing_store_; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 RunUntilIdle(); | 273 RunUntilIdle(); |
| 273 | 274 |
| 274 // Nothing changes. | 275 // Nothing changes. |
| 275 EXPECT_TRUE(factory()->CheckSingleOriginInUse(backing_store()->origin())); | 276 EXPECT_TRUE(factory()->CheckSingleOriginInUse(backing_store()->origin())); |
| 276 EXPECT_TRUE(backing_store()->CheckUnusedBlobsEmpty()); | 277 EXPECT_TRUE(backing_store()->CheckUnusedBlobsEmpty()); |
| 277 } | 278 } |
| 278 | 279 |
| 279 } // namespace | 280 } // namespace |
| 280 | 281 |
| 281 } // namespace content | 282 } // namespace content |
| OLD | NEW |