| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "modules/fetch/FetchFormDataConsumerHandle.h" | 5 #include "modules/fetch/FetchFormDataConsumerHandle.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMTypedArray.h" | 7 #include "core/dom/DOMTypedArray.h" |
| 8 #include "core/html/FormData.h" | 8 #include "core/html/FormData.h" |
| 9 #include "core/loader/MockThreadableLoader.h" | 9 #include "core/loader/MockThreadableLoader.h" |
| 10 #include "core/loader/ThreadableLoaderClient.h" | 10 #include "core/loader/ThreadableLoaderClient.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 PassRefPtr<EncodedFormData> complexFormData() | 85 PassRefPtr<EncodedFormData> complexFormData() |
| 86 { | 86 { |
| 87 RefPtr<EncodedFormData> data = EncodedFormData::create(); | 87 RefPtr<EncodedFormData> data = EncodedFormData::create(); |
| 88 | 88 |
| 89 data->appendData("foo", 3); | 89 data->appendData("foo", 3); |
| 90 data->appendFileRange("/foo/bar/baz", 3, 4, 5); | 90 data->appendFileRange("/foo/bar/baz", 3, 4, 5); |
| 91 data->appendFileSystemURLRange(KURL(KURL(), "file:///foo/bar/baz"), 6, 7, 8)
; | 91 data->appendFileSystemURLRange(KURL(KURL(), "file:///foo/bar/baz"), 6, 7, 8)
; |
| 92 std::unique_ptr<BlobData> blobData = BlobData::create(); | 92 std::unique_ptr<BlobData> blobData = BlobData::create(); |
| 93 blobData->appendText("hello", false); | 93 blobData->appendText("hello"); |
| 94 auto size = blobData->length(); | 94 auto size = blobData->length(); |
| 95 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(std::move(blo
bData), size); | 95 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(std::move(blo
bData), size); |
| 96 data->appendBlob(blobDataHandle->uuid(), blobDataHandle); | 96 data->appendBlob(blobDataHandle->uuid(), blobDataHandle); |
| 97 Vector<char> boundary; | 97 Vector<char> boundary; |
| 98 boundary.append("\0", 1); | 98 boundary.append("\0", 1); |
| 99 data->setBoundary(boundary); | 99 data->setBoundary(boundary); |
| 100 return data.release(); | 100 return data.release(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void verifyComplexFormData(EncodedFormData* data) | 103 void verifyComplexFormData(EncodedFormData* data) |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 EXPECT_EQ(kShouldWait, reader->beginRead(&buffer, kNone, &available)); | 437 EXPECT_EQ(kShouldWait, reader->beginRead(&buffer, kNone, &available)); |
| 438 testing::runPendingTasks(); | 438 testing::runPendingTasks(); |
| 439 EXPECT_EQ(kOk, reader->beginRead(&buffer, kNone, &available)); | 439 EXPECT_EQ(kOk, reader->beginRead(&buffer, kNone, &available)); |
| 440 EXPECT_FALSE(reader->drainAsFormData()); | 440 EXPECT_FALSE(reader->drainAsFormData()); |
| 441 reader->endRead(0); | 441 reader->endRead(0); |
| 442 EXPECT_FALSE(reader->drainAsFormData()); | 442 EXPECT_FALSE(reader->drainAsFormData()); |
| 443 } | 443 } |
| 444 | 444 |
| 445 } // namespace | 445 } // namespace |
| 446 } // namespace blink | 446 } // namespace blink |
| OLD | NEW |