| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/BytesConsumerForDataConsumerHandle.h" | 5 #include "modules/fetch/BytesConsumerForDataConsumerHandle.h" |
| 6 | 6 |
| 7 #include "core/testing/DummyPageHolder.h" | 7 #include "core/testing/DummyPageHolder.h" |
| 8 #include "modules/fetch/BytesConsumer.h" | 8 #include "modules/fetch/BytesConsumer.h" |
| 9 #include "modules/fetch/DataConsumerHandleTestUtil.h" | 9 #include "modules/fetch/DataConsumerHandleTestUtil.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 using Command = DataConsumerHandleTestUtil::Command; | 18 using Command = DataConsumerHandleTestUtil::Command; |
| 19 using Checkpoint = ::testing::StrictMock<::testing::MockFunction<void(int)>>; | 19 using Checkpoint = ::testing::StrictMock<::testing::MockFunction<void(int)>>; |
| 20 using ReplayingHandle = DataConsumerHandleTestUtil::ReplayingHandle; | 20 using ReplayingHandle = DataConsumerHandleTestUtil::ReplayingHandle; |
| 21 using Result = BytesConsumer::Result; | 21 using Result = BytesConsumer::Result; |
| 22 using ::testing::ByMove; |
| 22 using ::testing::InSequence; | 23 using ::testing::InSequence; |
| 23 using ::testing::Return; | 24 using ::testing::Return; |
| 24 | 25 |
| 25 class BytesConsumerForDataConsumerHandleTest : public ::testing::Test { | 26 class BytesConsumerForDataConsumerHandleTest : public ::testing::Test { |
| 26 public: | 27 public: |
| 27 Document* document() { return &m_page->document(); } | 28 Document* document() { return &m_page->document(); } |
| 28 | 29 |
| 29 protected: | 30 protected: |
| 30 BytesConsumerForDataConsumerHandleTest() | 31 BytesConsumerForDataConsumerHandleTest() |
| 31 : m_page(DummyPageHolder::create()) {} | 32 : m_page(DummyPageHolder::create()) {} |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 InSequence s; | 286 InSequence s; |
| 286 | 287 |
| 287 EXPECT_FALSE(consumer->drainAsFormData()); | 288 EXPECT_FALSE(consumer->drainAsFormData()); |
| 288 EXPECT_EQ(BytesConsumer::PublicState::ReadableOrWaiting, | 289 EXPECT_EQ(BytesConsumer::PublicState::ReadableOrWaiting, |
| 289 consumer->getPublicState()); | 290 consumer->getPublicState()); |
| 290 } | 291 } |
| 291 | 292 |
| 292 } // namespace | 293 } // namespace |
| 293 | 294 |
| 294 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |