#include "components/invalidation/impl/per_user_topic_subscription_request.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "base/values.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace invalidation {
namespace {
_;
DoAll;
SaveArg;
RequestType;
network::mojom::URLResponseHeadPtr CreateHeadersForTest(int responce_code) { … }
}
class PerUserTopicSubscriptionRequestTest : public testing::Test { … };
TEST_F(PerUserTopicSubscriptionRequestTest,
ShouldNotInvokeCallbackWhenCancelled) { … }
TEST_F(PerUserTopicSubscriptionRequestTest, ShouldSubscribeWithoutErrors) { … }
TEST_F(PerUserTopicSubscriptionRequestTest,
ShouleNotSubscribeWhenNetworkProblem) { … }
TEST_F(PerUserTopicSubscriptionRequestTest,
ShouldNotSubscribeWhenWrongResponse) { … }
TEST_F(PerUserTopicSubscriptionRequestTest, ShouldUnsubscribe) { … }
TEST_F(PerUserTopicSubscriptionRequestTest, ShouldDestroyOnFailure) { … }
class PerUserTopicSubscriptionRequestParamTest
: public PerUserTopicSubscriptionRequestTest,
public testing::WithParamInterface<net::HttpStatusCode> { … };
TEST_P(PerUserTopicSubscriptionRequestParamTest,
ShouldNotSubscribeWhenNonRepeatableError) { … }
INSTANTIATE_TEST_SUITE_P(…);
}