| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // No data was cleared because of SetForceKeepSessionState. | 130 // No data was cleared because of SetForceKeepSessionState. |
| 131 EXPECT_TRUE(base::DirectoryExists(normal_path)); | 131 EXPECT_TRUE(base::DirectoryExists(normal_path)); |
| 132 EXPECT_TRUE(base::DirectoryExists(session_only_path)); | 132 EXPECT_TRUE(base::DirectoryExists(session_only_path)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 class ForceCloseDBCallbacks : public IndexedDBCallbacks { | 135 class ForceCloseDBCallbacks : public IndexedDBCallbacks { |
| 136 public: | 136 public: |
| 137 ForceCloseDBCallbacks(scoped_refptr<IndexedDBContextImpl> idb_context, | 137 ForceCloseDBCallbacks(scoped_refptr<IndexedDBContextImpl> idb_context, |
| 138 const Origin& origin) | 138 const Origin& origin) |
| 139 : IndexedDBCallbacks(NULL, 0, 0), | 139 : /*IndexedDBCallbacks(NULL, 0, 0),*/ |
| 140 idb_context_(idb_context), | 140 idb_context_(idb_context), |
| 141 origin_(origin) {} | 141 origin_(origin) {} |
| 142 | 142 |
| 143 void OnSuccess() override {} | 143 void OnSuccess() override {} |
| 144 void OnSuccess(const std::vector<base::string16>&) override {} | 144 void OnSuccess(const std::vector<base::string16>&) override {} |
| 145 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, | 145 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, |
| 146 const IndexedDBDatabaseMetadata& metadata) override { | 146 const IndexedDBDatabaseMetadata& metadata) override { |
| 147 connection_ = std::move(connection); | 147 connection_ = std::move(connection); |
| 148 idb_context_->ConnectionOpened(origin_, connection_.get()); | 148 idb_context_->ConnectionOpened(origin_, connection_.get()); |
| 149 } | 149 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 // Simulate the write failure. | 291 // Simulate the write failure. |
| 292 leveldb::Status status = leveldb::Status::IOError("Simulated failure"); | 292 leveldb::Status status = leveldb::Status::IOError("Simulated failure"); |
| 293 callbacks->connection()->database()->TransactionCommitFailed(status); | 293 callbacks->connection()->database()->TransactionCommitFailed(status); |
| 294 | 294 |
| 295 EXPECT_TRUE(db_callbacks->forced_close_called()); | 295 EXPECT_TRUE(db_callbacks->forced_close_called()); |
| 296 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin)); | 296 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace content | 299 } // namespace content |
| OLD | NEW |