#include "google_apis/gcm/engine/fake_connection_handler.h"
#include <utility>
#include "base/logging.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "net/socket/stream_socket.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
namespace {
std::unique_ptr<google::protobuf::MessageLite> BuildLoginResponse(
bool fail_login) { … }
}
FakeConnectionHandler::FakeConnectionHandler(
const ConnectionHandler::ProtoReceivedCallback& read_callback,
const ConnectionHandler::ProtoSentCallback& write_callback,
const ConnectionHandler::ConnectionChangedCallback& connection_callback)
: … { … }
FakeConnectionHandler::~FakeConnectionHandler() { … }
void FakeConnectionHandler::Init(
const mcs_proto::LoginRequest& login_request,
mojo::ScopedDataPipeConsumerHandle receive_stream,
mojo::ScopedDataPipeProducerHandle send_stream) { … }
void FakeConnectionHandler::Reset() { … }
bool FakeConnectionHandler::CanSendMessage() const { … }
void FakeConnectionHandler::SendMessage(
const google::protobuf::MessageLite& message) { … }
void FakeConnectionHandler::ExpectOutgoingMessage(const MCSMessage& message) { … }
void FakeConnectionHandler::ResetOutgoingMessageExpectations() { … }
bool FakeConnectionHandler::AllOutgoingMessagesReceived() const { … }
void FakeConnectionHandler::ReceiveMessage(const MCSMessage& message) { … }
}