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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/BytesConsumerTestUtil.h

Issue 2292763002: [Fetch API] Implement Request.formData and Response.formData. (Closed)
Patch Set: More global-interface-listing*-expected.txt, urlencoded-parser-expected.txt Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BytesConsumerTestUtil_h 5 #ifndef BytesConsumerTestUtil_h
6 #define BytesConsumerTestUtil_h 6 #define BytesConsumerTestUtil_h
7 7
8 #include "modules/fetch/BytesConsumer.h" 8 #include "modules/fetch/BytesConsumer.h"
9 #include "modules/fetch/FetchDataLoader.h" 9 #include "modules/fetch/FetchDataLoader.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 public: 52 public:
53 static ::testing::StrictMock<MockFetchDataLoaderClient>* Create() { 53 static ::testing::StrictMock<MockFetchDataLoaderClient>* Create() {
54 return new ::testing::StrictMock<MockFetchDataLoaderClient>; 54 return new ::testing::StrictMock<MockFetchDataLoaderClient>;
55 } 55 }
56 56
57 DEFINE_INLINE_VIRTUAL_TRACE() { FetchDataLoader::Client::Trace(visitor); } 57 DEFINE_INLINE_VIRTUAL_TRACE() { FetchDataLoader::Client::Trace(visitor); }
58 58
59 MOCK_METHOD1(DidFetchDataLoadedBlobHandleMock, 59 MOCK_METHOD1(DidFetchDataLoadedBlobHandleMock,
60 void(RefPtr<BlobDataHandle>)); 60 void(RefPtr<BlobDataHandle>));
61 MOCK_METHOD1(DidFetchDataLoadedArrayBufferMock, void(DOMArrayBuffer*)); 61 MOCK_METHOD1(DidFetchDataLoadedArrayBufferMock, void(DOMArrayBuffer*));
62 MOCK_METHOD1(DidFetchDataLoadedFormDataMock, void(FormData*));
62 MOCK_METHOD1(DidFetchDataLoadedString, void(const String&)); 63 MOCK_METHOD1(DidFetchDataLoadedString, void(const String&));
63 MOCK_METHOD0(DidFetchDataLoadStream, void()); 64 MOCK_METHOD0(DidFetchDataLoadStream, void());
64 MOCK_METHOD0(DidFetchDataLoadFailed, void()); 65 MOCK_METHOD0(DidFetchDataLoadFailed, void());
65 66
66 void DidFetchDataLoadedArrayBuffer(DOMArrayBuffer* array_buffer) override { 67 void DidFetchDataLoadedArrayBuffer(DOMArrayBuffer* array_buffer) override {
67 DidFetchDataLoadedArrayBufferMock(array_buffer); 68 DidFetchDataLoadedArrayBufferMock(array_buffer);
68 } 69 }
69 // In mock methods we use RefPtr<> rather than PassRefPtr<>. 70 // In mock methods we use RefPtr<> rather than PassRefPtr<>.
70 void DidFetchDataLoadedBlobHandle( 71 void DidFetchDataLoadedBlobHandle(
71 PassRefPtr<BlobDataHandle> blob_data_handle) override { 72 PassRefPtr<BlobDataHandle> blob_data_handle) override {
72 DidFetchDataLoadedBlobHandleMock(std::move(blob_data_handle)); 73 DidFetchDataLoadedBlobHandleMock(std::move(blob_data_handle));
73 } 74 }
75 void DidFetchDataLoadedFormData(FormData* FormData) override {
76 DidFetchDataLoadedFormDataMock(FormData);
77 }
74 }; 78 };
75 79
76 class Command final { 80 class Command final {
77 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 81 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
78 82
79 public: 83 public:
80 enum Name { 84 enum Name {
81 kData, 85 kData,
82 kDone, 86 kDone,
83 kError, 87 kError,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 private: 162 private:
159 Member<BytesConsumer> consumer_; 163 Member<BytesConsumer> consumer_;
160 BytesConsumer::Result result_ = BytesConsumer::Result::kShouldWait; 164 BytesConsumer::Result result_ = BytesConsumer::Result::kShouldWait;
161 Vector<char> data_; 165 Vector<char> data_;
162 }; 166 };
163 }; 167 };
164 168
165 } // namespace blink 169 } // namespace blink
166 170
167 #endif // BytesConsumerTestUtil_h 171 #endif // BytesConsumerTestUtil_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698