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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp

Issue 2147633002: Remove nonstandard 'endings' option for Blob/File constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Layout test updates Created 4 years, 5 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698