#include "third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h"
#include "base/strings/stringprintf.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/platform/loader/fetch/data_pipe_bytes_consumer.h"
#include "third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.h"
#include "third_party/blink/renderer/platform/loader/testing/replaying_bytes_consumer.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
namespace blink {
namespace {
class BufferingBytesConsumerTest : public testing::Test { … };
TEST_F(BufferingBytesConsumerTest, Read) { … }
TEST_F(BufferingBytesConsumerTest, ReadWithDelay) { … }
TEST_F(BufferingBytesConsumerTest, Buffering) { … }
TEST_F(BufferingBytesConsumerTest, BufferingWithDelay) { … }
TEST_F(BufferingBytesConsumerTest, StopBuffering) { … }
TEST_F(BufferingBytesConsumerTest, DrainAsDataPipeFailsWithoutDelay) { … }
TEST_F(BufferingBytesConsumerTest, DrainAsDataPipeSucceedsWithDelay) { … }
TEST_F(BufferingBytesConsumerTest, DrainAsDataPipeFailsWithExpiredDelay) { … }
constexpr size_t kMaxBufferSize = …;
struct MaxBytesParams { … };
class BufferingBytesConsumerMaxBytesTest
: public BufferingBytesConsumerTest,
public ::testing::WithParamInterface<MaxBytesParams> { … };
TEST_P(BufferingBytesConsumerMaxBytesTest, ReadLargeResourceSuccessfully) { … }
TEST_P(BufferingBytesConsumerMaxBytesTest, ReadLargeResourceWithError) { … }
std::string PrintToString(const MaxBytesParams& params) { … }
constexpr size_t kSixDigitPrime = …;
constexpr size_t kNextMultipleOfSixDigitPrimeAfterMaxBufferSize = …;
INSTANTIATE_TEST_SUITE_P(…);
}
}