#include <queue>
#include <string>
#include <unordered_map>
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/gtest_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/commerce/core/commerce_constants.h"
#include "components/commerce/core/parcel/parcels_server_proxy.h"
#include "components/commerce/core/proto/parcel.pb.h"
#include "components/endpoint_fetcher/mock_endpoint_fetcher.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.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/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
InSequence;
namespace {
const char kParcelsBaseUrl[] = …;
const char kParcelsStatusUrl[] = …;
const char kParcelsUntrackUrl[] = …;
const std::string kExpectedGetParcelStatusPostData = …;
const std::string kResponseSucceeded = …;
const std::string kExpectedStartTrackingPostData = …;
const std::string kExpectedStopTrackingPostData = …;
const std::string kTestTrackingUrl = …;
const std::string kTestTrackingId = …;
const std::string kTestSourcePageDomain = …;
std::vector<commerce::ParcelIdentifier> GetTestParcelIdentifiers() { … }
int64_t GetExpectedDeliveryTimeUsec() { … }
}
namespace commerce {
class MockParcelsServerProxy : public ParcelsServerProxy { … };
class ParcelsServerProxyTest : public testing::Test { … };
TEST_F(ParcelsServerProxyTest, TestGetParcelStatus) { … }
TEST_F(ParcelsServerProxyTest, TestGetParcelStatusWithErrorResponse) { … }
TEST_F(ParcelsServerProxyTest, TestGetParcelStatusWithoutTrackingId) { … }
TEST_F(ParcelsServerProxyTest, TestGetParcelStatusWithServerError) { … }
TEST_F(ParcelsServerProxyTest, TestStartTrackingParcelsWithServerError) { … }
TEST_F(ParcelsServerProxyTest, TestStartTrackingParcels) { … }
TEST_F(ParcelsServerProxyTest, TestStopTrackingParcel) { … }
TEST_F(ParcelsServerProxyTest, TestStopTrackingParcels) { … }
TEST_F(ParcelsServerProxyTest, TestStopTrackingAllParcels) { … }
TEST_F(ParcelsServerProxyTest, TestStopTrackingAllParcelsWithServerError) { … }
}