Index: third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp |
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp |
index 8bd2ab07ea2a2bbf8142daab88b0d764c5f7bf67..9aac7bfbc344fdb9e57f431fb8a02e035944ec3f 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp |
@@ -35,7 +35,6 @@ |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
#include "modules/indexeddb/IDBDatabase.h" |
-#include "modules/indexeddb/IDBDatabaseCallbacks.h" |
#include "modules/indexeddb/MockWebIDBDatabase.h" |
#include "platform/SharedBuffer.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -50,24 +49,13 @@ void deactivateNewTransactions(v8::Isolate* isolate) |
V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); |
} |
-class FakeIDBDatabaseCallbacks final : public IDBDatabaseCallbacks { |
-public: |
- static FakeIDBDatabaseCallbacks* create() { return new FakeIDBDatabaseCallbacks(); } |
- void onVersionChange(int64_t oldVersion, int64_t newVersion) override { } |
- void onForcedClose() override { } |
- void onAbort(int64_t transactionId, DOMException* error) override { } |
- void onComplete(int64_t transactionId) override { } |
-private: |
- FakeIDBDatabaseCallbacks() { } |
-}; |
- |
TEST(IDBTransactionTest, EnsureLifetime) |
{ |
V8TestingScope scope; |
std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); |
EXPECT_CALL(*backend, close()) |
.Times(1); |
- Persistent<IDBDatabase> db = IDBDatabase::create(scope.getExecutionContext(), std::move(backend), FakeIDBDatabaseCallbacks::create()); |
+ Persistent<IDBDatabase> db = IDBDatabase::create(scope.getExecutionContext(), std::move(backend), nullptr); |
const int64_t transactionId = 1234; |
const HashSet<String> transactionScope = HashSet<String>(); |
@@ -104,7 +92,7 @@ TEST(IDBTransactionTest, TransactionFinish) |
.Times(1); |
EXPECT_CALL(*backend, close()) |
.Times(1); |
- Persistent<IDBDatabase> db = IDBDatabase::create(scope.getExecutionContext(), std::move(backend), FakeIDBDatabaseCallbacks::create()); |
+ Persistent<IDBDatabase> db = IDBDatabase::create(scope.getExecutionContext(), std::move(backend), nullptr); |
const HashSet<String> transactionScope = HashSet<String>(); |
Persistent<IDBTransaction> transaction = IDBTransaction::create(scope.getScriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get()); |
@@ -129,7 +117,10 @@ TEST(IDBTransactionTest, TransactionFinish) |
// Fire an abort to make sure this doesn't free the transaction during use. The test |
// will not fail if it is, but ASAN would notice the error. |
- db->onAbort(transactionId, DOMException::create(AbortError, "Aborted")); |
+ auto errorInfo = indexed_db::mojom::blink::ErrorInfo::New(); |
+ errorInfo->code = AbortError; |
+ errorInfo->message = "Aborted"; |
+ db->OnTransactionAborted(transactionId, std::move(errorInfo)); |
// onAbort() should have cleared the transaction's reference to the database. |
ThreadState::current()-> collectAllGarbage(); |