#include "components/feedback/feedback_uploader.h"
#include <string>
#include "base/files/scoped_temp_dir.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/task/task_traits.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "components/feedback/feedback_common.h"
#include "components/feedback/feedback_constants.h"
#include "components/variations/net/variations_http_headers.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_ids_provider.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.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 "testing/gtest/include/gtest/gtest.h"
namespace feedback {
namespace {
constexpr base::TimeDelta kTestRetryDelay = …;
constexpr char kFeedbackPostUrl[] = …;
void QueueReport(FeedbackUploader* uploader,
const std::string& report_data,
bool has_email = true,
int product_id = 0) { … }
class TestFeedbackUploader final : public FeedbackUploader { … };
class MockFeedbackUploaderChrome final : public FeedbackUploader { … };
}
class FeedbackUploaderDispatchTest : public ::testing::Test { … };
TEST_F(FeedbackUploaderDispatchTest, VariationHeaders) { … }
TEST_F(FeedbackUploaderDispatchTest, VariationHeadersForProductID) { … }
TEST_F(FeedbackUploaderDispatchTest, NoVariationHeadersForOrcaProductID) { … }
TEST_F(FeedbackUploaderDispatchTest, BearerTokenWithEmail) { … }
TEST_F(FeedbackUploaderDispatchTest, BearerTokenNoEmail) { … }
TEST_F(FeedbackUploaderDispatchTest, 204Response) { … }
TEST_F(FeedbackUploaderDispatchTest, 400Response) { … }
TEST_F(FeedbackUploaderDispatchTest, 500Response) { … }
}