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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Allow cpp_only to be set by the invoker. Created 4 years, 3 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 17c1708757535e34c66f49af5e8c40e3e49d2807..f14c6370a48477c653f4a50665ae12be287c401b 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"
@@ -92,20 +93,19 @@ 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()->stopActiveDOMObjects();
- request->onUpgradeNeeded(oldVersion, std::move(backend), metadata, WebIDBDataLossNone, String());
+ callbacks->onUpgradeNeeded(oldVersion, backend.release(), metadata, WebIDBDataLossNone, String());
}
{
@@ -114,9 +114,10 @@ TEST(IDBRequestTest, ConnectionsAfterStopping)
.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()->stopActiveDOMObjects();
- request->onSuccess(std::move(backend), metadata);
+ callbacks->onSuccess(backend.release(), metadata);
}
}

Powered by Google App Engine
This is Rietveld 408576698