// 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. #ifndef COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_MANIFEST_DOWNLOADER_H_ #define COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_MANIFEST_DOWNLOADER_H_ #include <map> #include <memory> #include <string> #include "base/memory/weak_ptr.h" #include "components/payments/core/payment_manifest_downloader.h" class GURL; template <class T> class scoped_refptr; namespace network { class SharedURLLoaderFactory; } namespace payments { class CSPChecker; // Downloads payment method manifests from the test server. // // Sample usage #1: // // TestDownloader downloader(csp_checker, url_loader_factory); // downloader.AddTestServerURL("https://", "https://127.0.0.1:7070"); // // Actual URL downloaded is https://127.0.0.1:7070/alicepay.test/webpay. // downloader.DownloadPaymentMethodManifest( // "https://alicepay.test/webpay", callback); // // Sample usage #2: // // TestDownloader downloader(csp_checker, url_loader_factory); // downloader.AddTestServerURL( // "https://alicepay.test", "https://127.0.0.1:8080"); // downloader.AddTestServerURL( // "https://bobpay.test", "https://127.0.0.1:9090"); // // Actual URL downloaded is https://127.0.0.1:8080/webpay. // downloader.DownloadPaymentMethodManifest( // "https://alicepay.test/webpay", callback); // // Actual URL downloaded is https://127.0.0.1:9090/webpay. // downloader.DownloadPaymentMethodManifest( // "https://bobpay.test/webpay", callback); class TestDownloader : public PaymentManifestDownloader { … }; } // namespace payments #endif // COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_MANIFEST_DOWNLOADER_H_