#include "remoting/base/protobuf_http_stream_parser.h"
#include <memory>
#include <string>
#include "base/test/mock_callback.h"
#include "remoting/base/protobuf_http_client_messages.pb.h"
#include "remoting/base/protobuf_http_client_test_messages.pb.h"
#include "remoting/base/protobuf_http_status.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting {
namespace {
_;
constexpr char kFirstTestMessage[] = …;
constexpr char kSecondTestMessage[] = …;
constexpr char kThirdTestMessage[] = …;
MATCHER(IsCancelStatus, "") { … }
protobufhttpclient::StreamBody CreateDefaultStream() { … }
std::string CreateDefaultStreamData() { … }
void SplitStringInMiddle(const std::string& input,
std::string* str_1,
std::string* str_2) { … }
}
class ProtobufHttpStreamParserTest : public testing::Test { … };
void ProtobufHttpStreamParserTest::ExpectReceiveDefaultStreamData() { … }
TEST_F(ProtobufHttpStreamParserTest, ParseStreamBodyInOneShot) { … }
TEST_F(ProtobufHttpStreamParserTest, ParseSplitStreamBody) { … }
TEST_F(ProtobufHttpStreamParserTest, CloseStreamWithCancelled) { … }
TEST_F(ProtobufHttpStreamParserTest, ParseStreamBodyWithNoops_NoopsIgnored) { … }
TEST_F(ProtobufHttpStreamParserTest,
ParseSplitStreamBodyWithOnlyNoops_NoopsIgnored) { … }
TEST_F(ProtobufHttpStreamParserTest,
ParseStreamBodyWithInvalidMessages_StreamIsClosed) { … }
TEST_F(ProtobufHttpStreamParserTest,
ParseStreamBodyWithInvalidStatus_StreamIsClosed) { … }
}