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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Require explicit wrapping when discarding map keys. Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
index 89a6807a4e1d08a0fa511bf5dc445fa091894095..05c3f4a27c8d2e3cfbe3f18381c1b74883483bc9 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
@@ -38,6 +38,7 @@
#include "modules/indexeddb/IDBValue.h"
#include "modules/indexeddb/MockWebIDBDatabase.h"
#include "platform/SharedBuffer.h"
+#include "public/platform/modules/indexeddb/WebIDBCallbacks.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/PassRefPtr.h"
#include "wtf/Vector.h"
@@ -94,20 +95,20 @@ TEST(IDBRequestTest, ConnectionsAfterStopping) {
const int64_t transactionId = 1234;
const int64_t version = 1;
const int64_t oldVersion = 0;
- const IDBDatabaseMetadata metadata;
+ const WebIDBMetadata metadata;
Persistent<IDBDatabaseCallbacks> callbacks = IDBDatabaseCallbacks::create();
{
std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create();
- EXPECT_CALL(*backend, abort(transactionId)).Times(1);
EXPECT_CALL(*backend, close()).Times(1);
IDBOpenDBRequest* request = IDBOpenDBRequest::create(
scope.getScriptState(), callbacks, transactionId, version);
EXPECT_EQ(request->readyState(), "pending");
+ std::unique_ptr<WebIDBCallbacks> callbacks = request->createWebCallbacks();
scope.getExecutionContext()->notifyContextDestroyed();
- request->onUpgradeNeeded(oldVersion, std::move(backend), metadata,
- WebIDBDataLossNone, String());
+ callbacks->onUpgradeNeeded(oldVersion, backend.release(), metadata,
+ WebIDBDataLossNone, String());
}
{
@@ -116,9 +117,10 @@ TEST(IDBRequestTest, ConnectionsAfterStopping) {
IDBOpenDBRequest* request = IDBOpenDBRequest::create(
scope.getScriptState(), callbacks, transactionId, version);
EXPECT_EQ(request->readyState(), "pending");
+ std::unique_ptr<WebIDBCallbacks> callbacks = request->createWebCallbacks();
scope.getExecutionContext()->notifyContextDestroyed();
- request->onSuccess(std::move(backend), metadata);
+ callbacks->onSuccess(backend.release(), metadata);
}
}

Powered by Google App Engine
This is Rietveld 408576698