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/DataConsumerTee.h" | 5 #include "modules/fetch/DataConsumerTee.h" |
6 | 6 |
7 #include "core/testing/DummyPageHolder.h" | 7 #include "core/testing/DummyPageHolder.h" |
8 #include "core/testing/NullExecutionContext.h" | 8 #include "core/testing/NullExecutionContext.h" |
9 #include "modules/fetch/DataConsumerHandleTestUtil.h" | 9 #include "modules/fetch/DataConsumerHandleTestUtil.h" |
10 #include "platform/ThreadSafeFunctional.h" | 10 #include "platform/ThreadSafeFunctional.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 OwnPtr<TeeCreationThread<WebDataConsumerHandle>> t = adoptPtr(new TeeCreatio
nThread<WebDataConsumerHandle>()); | 313 OwnPtr<TeeCreationThread<WebDataConsumerHandle>> t = adoptPtr(new TeeCreatio
nThread<WebDataConsumerHandle>()); |
314 t->run(src.release(), &dest1, &dest2); | 314 t->run(src.release(), &dest1, &dest2); |
315 | 315 |
316 ASSERT_TRUE(dest1); | 316 ASSERT_TRUE(dest1); |
317 ASSERT_TRUE(dest2); | 317 ASSERT_TRUE(dest2); |
318 | 318 |
319 dest1 = nullptr; | 319 dest1 = nullptr; |
320 dest2 = nullptr; | 320 dest2 = nullptr; |
321 | 321 |
322 // Collect garbage to finalize the source reader. | 322 // Collect garbage to finalize the source reader. |
323 ThreadHeap::collectAllGarbage(); | 323 Heap::collectAllGarbage(); |
324 context->detached()->wait(); | 324 context->detached()->wait(); |
325 } | 325 } |
326 | 326 |
327 TEST(FetchDataConsumerTeeTest, Create) | 327 TEST(FetchDataConsumerTeeTest, Create) |
328 { | 328 { |
329 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(); | 329 RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(); |
330 OwnPtr<MockFetchDataConsumerHandle> src(MockFetchDataConsumerHandle::create(
)); | 330 OwnPtr<MockFetchDataConsumerHandle> src(MockFetchDataConsumerHandle::create(
)); |
331 OwnPtr<MockFetchDataConsumerReader> reader(MockFetchDataConsumerReader::crea
te()); | 331 OwnPtr<MockFetchDataConsumerReader> reader(MockFetchDataConsumerReader::crea
te()); |
332 | 332 |
333 Checkpoint checkpoint; | 333 Checkpoint checkpoint; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 OwnPtr<HandleReadResult> res2 = r2.wait(); | 408 OwnPtr<HandleReadResult> res2 = r2.wait(); |
409 | 409 |
410 EXPECT_EQ(kDone, res1->result()); | 410 EXPECT_EQ(kDone, res1->result()); |
411 EXPECT_EQ(0u, res1->data().size()); | 411 EXPECT_EQ(0u, res1->data().size()); |
412 EXPECT_EQ(kDone, res2->result()); | 412 EXPECT_EQ(kDone, res2->result()); |
413 EXPECT_EQ(0u, res2->data().size()); | 413 EXPECT_EQ(0u, res2->data().size()); |
414 } | 414 } |
415 | 415 |
416 } // namespace | 416 } // namespace |
417 } // namespace blink | 417 } // namespace blink |
OLD | NEW |