#include "components/sharing_message/web_push/web_push_sender.h"
#include "base/base64.h"
#include "base/base64url.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/test/task_environment.h"
#include "crypto/ec_private_key.h"
#include "net/http/http_request_headers.h"
#include "services/network/public/cpp/data_element.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "services/network/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/re2/src/re2/re2.h"
namespace {
const char kPrivateKey[] = …;
}
WebPushMessage CreateMessage() { … }
class WebPushSenderTest : public testing::Test { … };
WebPushSenderTest::WebPushSenderTest() = default;
WebPushSenderTest::~WebPushSenderTest() = default;
void WebPushSenderTest::SetUp() { … }
TEST_F(WebPushSenderTest, SendMessageTest) { … }
struct WebPushUrgencyTestData { … } kWebPushUrgencyTestData[] = …;
class WebPushUrgencyTest
: public WebPushSenderTest,
public testing::WithParamInterface<WebPushUrgencyTestData> { … };
TEST_P(WebPushUrgencyTest, SetUrgencyTest) { … }
INSTANTIATE_TEST_SUITE_P(…);
struct WebPushHttpStatusTestData { … } kWebPushHttpStatusTestData[] = …;
class WebPushHttpStatusTest
: public WebPushSenderTest,
public testing::WithParamInterface<WebPushHttpStatusTestData> { … };
TEST_P(WebPushHttpStatusTest, HttpStatusTest) { … }
INSTANTIATE_TEST_SUITE_P(…);