OLD | NEW |
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 <memory> | 7 #include <memory> |
8 #include "bindings/core/v8/V8BindingForTesting.h" | 8 #include "bindings/core/v8/V8BindingForTesting.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/html/FormData.h" | 10 #include "core/html/FormData.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 EXPECT_TRUE(buffer->hasPendingActivity()); | 309 EXPECT_TRUE(buffer->hasPendingActivity()); |
310 | 310 |
311 checkpoint.Call(1); | 311 checkpoint.Call(1); |
312 testing::runPendingTasks(); | 312 testing::runPendingTasks(); |
313 checkpoint.Call(2); | 313 checkpoint.Call(2); |
314 | 314 |
315 EXPECT_TRUE(buffer->isStreamLocked()); | 315 EXPECT_TRUE(buffer->isStreamLocked()); |
316 EXPECT_TRUE(buffer->isStreamDisturbed()); | 316 EXPECT_TRUE(buffer->isStreamDisturbed()); |
317 EXPECT_FALSE(buffer->hasPendingActivity()); | 317 EXPECT_FALSE(buffer->hasPendingActivity()); |
318 ASSERT_TRUE(arrayBuffer); | 318 ASSERT_TRUE(arrayBuffer); |
319 EXPECT_EQ("hello", String(static_cast<const char*>(arrayBuffer->data()), | 319 EXPECT_EQ("hello", |
320 arrayBuffer->byteLength())); | 320 String(static_cast<const char*>(arrayBuffer->data()), |
| 321 arrayBuffer->byteLength())); |
321 } | 322 } |
322 | 323 |
323 TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsBlob) { | 324 TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsBlob) { |
324 V8TestingScope scope; | 325 V8TestingScope scope; |
325 Checkpoint checkpoint; | 326 Checkpoint checkpoint; |
326 MockFetchDataLoaderClient* client = MockFetchDataLoaderClient::create(); | 327 MockFetchDataLoaderClient* client = MockFetchDataLoaderClient::create(); |
327 RefPtr<BlobDataHandle> blobDataHandle; | 328 RefPtr<BlobDataHandle> blobDataHandle; |
328 | 329 |
329 InSequence s; | 330 InSequence s; |
330 EXPECT_CALL(checkpoint, Call(1)); | 331 EXPECT_CALL(checkpoint, Call(1)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 ScriptValue reason(scope.getScriptState(), | 477 ScriptValue reason(scope.getScriptState(), |
477 v8String(scope.getScriptState()->isolate(), "reason")); | 478 v8String(scope.getScriptState()->isolate(), "reason")); |
478 EXPECT_FALSE(consumer->isCancelled()); | 479 EXPECT_FALSE(consumer->isCancelled()); |
479 buffer->cancel(scope.getScriptState(), reason); | 480 buffer->cancel(scope.getScriptState(), reason); |
480 EXPECT_TRUE(consumer->isCancelled()); | 481 EXPECT_TRUE(consumer->isCancelled()); |
481 } | 482 } |
482 | 483 |
483 } // namespace | 484 } // namespace |
484 | 485 |
485 } // namespace blink | 486 } // namespace blink |
OLD | NEW |