#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_with_management_policy_apitest.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/background_script_executor.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "extensions/test/test_extension_dir.h"
#include "net/base/url_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_identity_test_util.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_server_config.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/test_data_directory.h"
#include "services/network/public/cpp/network_switches.h"
#include "url/gurl.h"
namespace extensions {
namespace {
class FakeClientCertStore : public net::ClientCertStore { … };
std::unique_ptr<net::ClientCertStore> CreateFakeClientCertStore() { … }
}
class BackgroundXhrTest : public ExtensionBrowserTest { … };
IN_PROC_BROWSER_TEST_F(BackgroundXhrTest, TlsClientAuth) { … }
IN_PROC_BROWSER_TEST_F(BackgroundXhrTest, HttpAuth) { … }
class BackgroundFetchPolicyTest : public ExtensionApiTestWithManagementPolicy { … };
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest, PolicyBlockedFetch) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest, PolicyUpdateFetch) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest, PolicyUpdateDefaultFetch) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest, PolicyUpdateIndividualFetch) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest, FetchAnyPortPermission) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest,
FetchPortSpecificPermissionAllow) { … }
IN_PROC_BROWSER_TEST_F(BackgroundFetchPolicyTest,
FetchPortSpecificPermissionBlock) { … }
constexpr char kNewWebstoreURL[] = …;
constexpr char kWebstoreAppBaseURL[] = …;
constexpr char kWebstoreOverrideURL[] = …;
constexpr char kNonWebstoreURL[] = …;
constexpr char kWebstorePath[] = …;
class BackgroundFetchWebstoreTest : public BackgroundFetchPolicyTest,
public testing::WithParamInterface<GURL> { … };
IN_PROC_BROWSER_TEST_P(BackgroundFetchWebstoreTest, FetchToWebstore) { … }
IN_PROC_BROWSER_TEST_P(BackgroundFetchWebstoreTest, FetchToWebstorePolicy) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}