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

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

Issue 2147633002: Remove nonstandard 'endings' option for Blob/File constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/BodyStreamBuffer.h" 5 #include "modules/fetch/BodyStreamBuffer.h"
6 6
7 #include "bindings/core/v8/V8BindingForTesting.h" 7 #include "bindings/core/v8/V8BindingForTesting.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/html/FormData.h" 9 #include "core/html/FormData.h"
10 #include "modules/fetch/BlobBytesConsumer.h" 10 #include "modules/fetch/BlobBytesConsumer.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 new2->startLoading(FetchDataLoader::createLoaderAsString(), client2); 158 new2->startLoading(FetchDataLoader::createLoaderAsString(), client2);
159 checkpoint.Call(3); 159 checkpoint.Call(3);
160 testing::runPendingTasks(); 160 testing::runPendingTasks();
161 checkpoint.Call(4); 161 checkpoint.Call(4);
162 } 162 }
163 163
164 TEST_F(BodyStreamBufferTest, DrainAsBlobDataHandle) { 164 TEST_F(BodyStreamBufferTest, DrainAsBlobDataHandle) {
165 V8TestingScope scope; 165 V8TestingScope scope;
166 std::unique_ptr<BlobData> data = BlobData::create(); 166 std::unique_ptr<BlobData> data = BlobData::create();
167 data->appendText("hello", false); 167 data->appendText("hello");
168 auto size = data->length(); 168 auto size = data->length();
169 RefPtr<BlobDataHandle> blobDataHandle = 169 RefPtr<BlobDataHandle> blobDataHandle =
170 BlobDataHandle::create(std::move(data), size); 170 BlobDataHandle::create(std::move(data), size);
171 BodyStreamBuffer* buffer = new BodyStreamBuffer( 171 BodyStreamBuffer* buffer = new BodyStreamBuffer(
172 scope.getScriptState(), 172 scope.getScriptState(),
173 new BlobBytesConsumer(scope.getExecutionContext(), blobDataHandle)); 173 new BlobBytesConsumer(scope.getExecutionContext(), blobDataHandle));
174 174
175 EXPECT_FALSE(buffer->isStreamLocked()); 175 EXPECT_FALSE(buffer->isStreamLocked());
176 EXPECT_FALSE(buffer->isStreamDisturbed()); 176 EXPECT_FALSE(buffer->isStreamDisturbed());
177 EXPECT_FALSE(buffer->hasPendingActivity()); 177 EXPECT_FALSE(buffer->hasPendingActivity());
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 ScriptValue reason(scope.getScriptState(), 476 ScriptValue reason(scope.getScriptState(),
477 v8String(scope.getScriptState()->isolate(), "reason")); 477 v8String(scope.getScriptState()->isolate(), "reason"));
478 EXPECT_FALSE(consumer->isCancelled()); 478 EXPECT_FALSE(consumer->isCancelled());
479 buffer->cancel(scope.getScriptState(), reason); 479 buffer->cancel(scope.getScriptState(), reason);
480 EXPECT_TRUE(consumer->isCancelled()); 480 EXPECT_TRUE(consumer->isCancelled());
481 } 481 }
482 482
483 } // namespace 483 } // namespace
484 484
485 } // namespace blink 485 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698