#include "remoting/base/telemetry_log_writer.h"
#include <array>
#include "base/containers/circular_deque.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/timer/timer.h"
#include "net/http/http_status_code.h"
#include "remoting/base/chromoting_event.h"
#include "remoting/base/fake_oauth_token_getter.h"
#include "remoting/base/protobuf_http_status.h"
#include "remoting/base/protobuf_http_test_responder.h"
#include "remoting/proto/remoting/v1/telemetry_messages.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting {
namespace {
MATCHER_P(HasDurations, durations, "") { … }
template <typename... Args>
std::array<int, sizeof...(Args)> MakeIntArray(Args&&... args) { … }
#define EXPECT_EVENTS(responder, durations) …
decltype(auto) DoSucceed(ProtobufHttpTestResponder* responder) { … }
decltype(auto) DoFail(ProtobufHttpTestResponder* responder) { … }
}
class TelemetryLogWriterTest : public testing::Test { … };
TEST_F(TelemetryLogWriterTest, PostOneLogImmediately) { … }
TEST_F(TelemetryLogWriterTest, PostOneLogAndHaveTwoPendingLogs) { … }
TEST_F(TelemetryLogWriterTest, PostLogFailedAndRetry) { … }
TEST_F(TelemetryLogWriterTest, PostOneLogFailedResendWithTwoPendingLogs) { … }
TEST_F(TelemetryLogWriterTest, PostThreeLogsFailedAndResendWithOnePending) { … }
TEST_F(TelemetryLogWriterTest, PostOneFailedThenSucceed) { … }
}