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 "content/browser/indexed_db/indexed_db_factory.h" | 5 #include "content/browser/indexed_db/indexed_db_factory.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 public: | 393 public: |
394 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, | 394 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, |
395 const IndexedDBDatabaseMetadata& metadata) OVERRIDE { | 395 const IndexedDBDatabaseMetadata& metadata) OVERRIDE { |
396 EXPECT_TRUE(connection_.get()); | 396 EXPECT_TRUE(connection_.get()); |
397 EXPECT_FALSE(connection.get()); | 397 EXPECT_FALSE(connection.get()); |
398 } | 398 } |
399 | 399 |
400 virtual void OnUpgradeNeeded( | 400 virtual void OnUpgradeNeeded( |
401 int64 old_version, | 401 int64 old_version, |
402 scoped_ptr<IndexedDBConnection> connection, | 402 scoped_ptr<IndexedDBConnection> connection, |
403 const content::IndexedDBDatabaseMetadata& metadata, | 403 const content::IndexedDBDatabaseMetadata& metadata) OVERRIDE { |
404 blink::WebIDBDataLoss data_loss, | |
405 std::string data_loss_message) OVERRIDE { | |
406 connection_ = connection.Pass(); | 404 connection_ = connection.Pass(); |
407 } | 405 } |
408 | 406 |
409 protected: | 407 protected: |
410 virtual ~UpgradeNeededCallbacks() {} | 408 virtual ~UpgradeNeededCallbacks() {} |
411 }; | 409 }; |
412 | 410 |
413 class ErrorCallbacks : public MockIndexedDBCallbacks { | 411 class ErrorCallbacks : public MockIndexedDBCallbacks { |
414 public: | 412 public: |
415 ErrorCallbacks() : MockIndexedDBCallbacks(false), saw_error_(false) {} | 413 ErrorCallbacks() : MockIndexedDBCallbacks(false), saw_error_(false) {} |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 origin, | 470 origin, |
473 temp_directory.path()); | 471 temp_directory.path()); |
474 EXPECT_FALSE(factory->IsDatabaseOpen(origin, db_name)); | 472 EXPECT_FALSE(factory->IsDatabaseOpen(origin, db_name)); |
475 } | 473 } |
476 | 474 |
477 // Terminate all pending-close timers. | 475 // Terminate all pending-close timers. |
478 factory->ForceClose(origin); | 476 factory->ForceClose(origin); |
479 } | 477 } |
480 | 478 |
481 } // namespace content | 479 } // namespace content |
OLD | NEW |