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

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

Issue 2506773002: [IndexedDB] Integrating failures and corruption with transaction (Closed)
Patch Set: 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 (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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 EXPECT_TRUE(callbacks->connection()); 278 EXPECT_TRUE(callbacks->connection());
279 279
280 // ConnectionOpened() is usually called by the dispatcher. 280 // ConnectionOpened() is usually called by the dispatcher.
281 context->ConnectionOpened(kTestOrigin, callbacks->connection()); 281 context->ConnectionOpened(kTestOrigin, callbacks->connection());
282 282
283 EXPECT_TRUE(factory->IsBackingStoreOpen(kTestOrigin)); 283 EXPECT_TRUE(factory->IsBackingStoreOpen(kTestOrigin));
284 284
285 // Simulate the write failure. 285 // Simulate the write failure.
286 leveldb::Status status = leveldb::Status::IOError("Simulated failure"); 286 leveldb::Status status = leveldb::Status::IOError("Simulated failure");
287 callbacks->connection()->database()->TransactionCommitFailed(status); 287 context->GetIDBFactory()->HandleBackingStoreFailure(kTestOrigin);
288 288
289 EXPECT_TRUE(db_callbacks->forced_close_called()); 289 EXPECT_TRUE(db_callbacks->forced_close_called());
290 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin)); 290 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin));
291 } 291 }
292 292
293 } // namespace content 293 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698