chromium/components/feedback/feedback_uploader_dispatch_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {};

// Stand-in for the FeedbackUploaderChrome class that adds a fake bearer token
// to the request.
class MockFeedbackUploaderChrome final : public FeedbackUploader {};

}  // namespace

class FeedbackUploaderDispatchTest : public ::testing::Test {};

TEST_F(FeedbackUploaderDispatchTest, VariationHeaders) {}

TEST_F(FeedbackUploaderDispatchTest, VariationHeadersForProductID) {}

TEST_F(FeedbackUploaderDispatchTest, NoVariationHeadersForOrcaProductID) {}

// Test that the bearer token is present if there is an email address present in
// the report.
TEST_F(FeedbackUploaderDispatchTest, BearerTokenWithEmail) {}

TEST_F(FeedbackUploaderDispatchTest, BearerTokenNoEmail) {}

TEST_F(FeedbackUploaderDispatchTest, 204Response) {}

TEST_F(FeedbackUploaderDispatchTest, 400Response) {}

TEST_F(FeedbackUploaderDispatchTest, 500Response) {}

}  // namespace feedback