chromium/services/network/test/test_data_pipe_getter.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SERVICES_NETWORK_TEST_TEST_DATA_PIPE_GETTER_H_
#define SERVICES_NETWORK_TEST_TEST_DATA_PIPE_GETTER_H_

#include <memory>
#include <string>

#include "mojo/public/c/system/data_pipe.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "services/network/public/mojom/data_pipe_getter.mojom.h"

namespace network {

// A DataPipeGetter implementation for tests. It vends data pipes and writes the
// given string to them. Read() can be called multiple times, even if the caller
// closes the data pipe before all data is written. But it assumes that there is
// only one outstanding call to Read() at a time.
class TestDataPipeGetter : public mojom::DataPipeGetter {};

}  // namespace network

#endif  // SERVICES_NETWORK_TEST_TEST_DATA_PIPE_GETTER_H_