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

Unified Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp

Issue 2342233002: Remove Fetch[Blob|FormData]ConsumerHandle (Closed)
Patch Set: rebase 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/fetch/BodyStreamBufferTest.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
index e7c4beb20de41820a1afdc16d7dc273aa277cafc..67450d4dbd8636931366bda88ed73fc69be85427 100644
--- a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
@@ -6,10 +6,10 @@
#include "bindings/core/v8/V8BindingForTesting.h"
#include "core/html/FormData.h"
+#include "modules/fetch/BlobBytesConsumer.h"
#include "modules/fetch/BytesConsumerTestUtil.h"
#include "modules/fetch/DataConsumerHandleTestUtil.h"
-#include "modules/fetch/FetchBlobDataConsumerHandle.h"
-#include "modules/fetch/FetchFormDataConsumerHandle.h"
+#include "modules/fetch/FormDataBytesConsumer.h"
#include "platform/blob/BlobData.h"
#include "platform/blob/BlobURL.h"
#include "platform/network/EncodedFormData.h"
@@ -33,15 +33,6 @@ using Command = DataConsumerHandleTestUtil::Command;
using ReplayingHandle = DataConsumerHandleTestUtil::ReplayingHandle;
using MockFetchDataLoaderClient = DataConsumerHandleTestUtil::MockFetchDataLoaderClient;
-class FakeLoaderFactory : public FetchBlobDataConsumerHandle::LoaderFactory {
-public:
- ThreadableLoader* create(ExecutionContext&, ThreadableLoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&) override
- {
- ASSERT_NOT_REACHED();
- return nullptr;
- }
-};
-
class BodyStreamBufferTest : public ::testing::Test {
protected:
ScriptValue eval(ScriptState* scriptState, const char* s)
@@ -174,7 +165,7 @@ TEST_F(BodyStreamBufferTest, DrainAsBlobDataHandle)
data->appendText("hello", false);
auto size = data->length();
RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(std::move(data), size);
- BodyStreamBuffer* buffer = new BodyStreamBuffer(scope.getScriptState(), FetchBlobDataConsumerHandle::create(scope.getExecutionContext(), blobDataHandle, new FakeLoaderFactory));
+ BodyStreamBuffer* buffer = new BodyStreamBuffer(scope.getScriptState(), new BlobBytesConsumer(scope.getExecutionContext(), blobDataHandle));
EXPECT_FALSE(buffer->isStreamLocked());
EXPECT_FALSE(buffer->isStreamDisturbed());
@@ -232,7 +223,7 @@ TEST_F(BodyStreamBufferTest, DrainAsFormData)
data->append("name2", "value2");
RefPtr<EncodedFormData> inputFormData = data->encodeMultiPartFormData();
- BodyStreamBuffer* buffer = new BodyStreamBuffer(scope.getScriptState(), FetchFormDataConsumerHandle::create(scope.getExecutionContext(), inputFormData));
+ BodyStreamBuffer* buffer = new BodyStreamBuffer(scope.getScriptState(), new FormDataBytesConsumer(scope.getExecutionContext(), inputFormData));
EXPECT_FALSE(buffer->isStreamLocked());
EXPECT_FALSE(buffer->isStreamDisturbed());
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/BUILD.gn ('k') | third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698