OLD | NEW |
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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> |
6 | 7 |
7 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "base/test/test_simple_task_runner.h" | 14 #include "base/test/test_simple_task_runner.h" |
14 #include "content/browser/indexed_db/indexed_db_connection.h" | 15 #include "content/browser/indexed_db/indexed_db_connection.h" |
15 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 16 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 void OnSuccess(scoped_ptr<IndexedDBConnection> connection, | 443 void OnSuccess(scoped_ptr<IndexedDBConnection> connection, |
443 const IndexedDBDatabaseMetadata& metadata) override { | 444 const IndexedDBDatabaseMetadata& metadata) override { |
444 EXPECT_TRUE(connection_.get()); | 445 EXPECT_TRUE(connection_.get()); |
445 EXPECT_FALSE(connection.get()); | 446 EXPECT_FALSE(connection.get()); |
446 } | 447 } |
447 | 448 |
448 void OnUpgradeNeeded( | 449 void OnUpgradeNeeded( |
449 int64_t old_version, | 450 int64_t old_version, |
450 scoped_ptr<IndexedDBConnection> connection, | 451 scoped_ptr<IndexedDBConnection> connection, |
451 const content::IndexedDBDatabaseMetadata& metadata) override { | 452 const content::IndexedDBDatabaseMetadata& metadata) override { |
452 connection_ = connection.Pass(); | 453 connection_ = std::move(connection); |
453 } | 454 } |
454 | 455 |
455 protected: | 456 protected: |
456 ~UpgradeNeededCallbacks() override {} | 457 ~UpgradeNeededCallbacks() override {} |
457 | 458 |
458 private: | 459 private: |
459 DISALLOW_COPY_AND_ASSIGN(UpgradeNeededCallbacks); | 460 DISALLOW_COPY_AND_ASSIGN(UpgradeNeededCallbacks); |
460 }; | 461 }; |
461 | 462 |
462 class ErrorCallbacks : public MockIndexedDBCallbacks { | 463 class ErrorCallbacks : public MockIndexedDBCallbacks { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 temp_directory.path()); | 529 temp_directory.path()); |
529 EXPECT_TRUE(callbacks->saw_error()); | 530 EXPECT_TRUE(callbacks->saw_error()); |
530 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); | 531 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); |
531 } | 532 } |
532 | 533 |
533 // Terminate all pending-close timers. | 534 // Terminate all pending-close timers. |
534 factory()->ForceClose(origin); | 535 factory()->ForceClose(origin); |
535 } | 536 } |
536 | 537 |
537 } // namespace content | 538 } // namespace content |
OLD | NEW |