#include "chrome/browser/extensions/extension_apitest.h"
#include <stddef.h>
#include <memory>
#include <string_view>
#include <utility>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_run_loop_timeout.h"
#include "build/build_config.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/apps/app_service/browser_app_launcher.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/unpacked_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "content/public/common/content_switches.h"
#include "extensions/browser/api/test/test_api.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_paths.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/switches.h"
#include "extensions/test/result_catcher.h"
#include "net/base/filename_util.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
namespace extensions {
namespace {
const char kTestCustomArg[] = …;
const char kTestDataDirectory[] = …;
const char kTestWebSocketPort[] = …;
const char kEmbeddedTestServerPort[] = …;
}
ExtensionApiTest::ExtensionApiTest(ContextType context_type)
: … { … }
ExtensionApiTest::~ExtensionApiTest() = default;
void ExtensionApiTest::SetUpOnMainThread() { … }
void ExtensionApiTest::TearDownOnMainThread() { … }
bool ExtensionApiTest::RunExtensionTest(const char* extension_name) { … }
bool ExtensionApiTest::RunExtensionTest(const char* extension_name,
const RunOptions& run_options) { … }
bool ExtensionApiTest::RunExtensionTest(const char* extension_name,
const RunOptions& run_options,
const LoadOptions& load_options) { … }
bool ExtensionApiTest::RunExtensionTest(const base::FilePath& extension_path,
const RunOptions& run_options,
const LoadOptions& load_options) { … }
void ExtensionApiTest::OpenURL(const GURL& url, bool open_in_incognito) { … }
bool ExtensionApiTest::OpenTestURL(const GURL& url, bool open_in_incognito) { … }
const Extension* ExtensionApiTest::GetSingleLoadedExtension() { … }
bool ExtensionApiTest::StartEmbeddedTestServer() { … }
bool ExtensionApiTest::InitializeEmbeddedTestServer() { … }
void ExtensionApiTest::EmbeddedTestServerAcceptConnections() { … }
bool ExtensionApiTest::StartWebSocketServer(
const base::FilePath& root_directory,
bool enable_basic_auth) { … }
void ExtensionApiTest::SetCustomArg(std::string_view custom_arg) { … }
void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { … }
void ExtensionApiTest::UseHttpsTestServer() { … }
}