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

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

Issue 2376193004: Stop FetchDataLoaderTest from using [Web|Fetch]DataConsumerHandle. (Closed)
Patch Set: fix 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/BytesConsumerTestUtil.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp b/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp
index 1c2039d610df534961a4ca731aa3cee1ad9cafc1..12c4b7c09227f339ad0bf66b822cc2e6824cefae 100644
--- a/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.cpp
@@ -14,6 +14,19 @@
namespace blink {
using Result = BytesConsumer::Result;
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::SetArgPointee;
+
+BytesConsumerTestUtil::MockBytesConsumer::MockBytesConsumer()
+{
+ ON_CALL(*this, beginRead(_, _)).WillByDefault(DoAll(SetArgPointee<0>(nullptr), SetArgPointee<1>(0), Return(Result::Error)));
+ ON_CALL(*this, endRead(_)).WillByDefault(Return(Result::Error));
+ ON_CALL(*this, getPublicState()).WillByDefault(Return(PublicState::Errored));
+ ON_CALL(*this, drainAsBlobDataHandle(_)).WillByDefault(Return(nullptr));
+ ON_CALL(*this, drainAsFormData()).WillByDefault(Return(nullptr));
+}
BytesConsumerTestUtil::ReplayingBytesConsumer::ReplayingBytesConsumer(ExecutionContext* executionContext)
: m_executionContext(executionContext)

Powered by Google App Engine
This is Rietveld 408576698