#include "chrome/browser/accessibility/embedded_a11y_extension_loader.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_system.h"
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/lacros/embedded_a11y_manager_lacros.h"
#endif
class EmbeddedA11yExtensionLoaderTest : public InProcessBrowserTest { … };
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
IN_PROC_BROWSER_TEST_F(EmbeddedA11yExtensionLoaderTest,
InstallsRemovesAndReinstallsExtension) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(EmbeddedA11yExtensionLoaderTest,
InstallsOnMultipleProfiles) { … }
#endif
IN_PROC_BROWSER_TEST_F(EmbeddedA11yExtensionLoaderTest,
InstallsOnIncognitoProfile) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(EmbeddedA11yExtensionLoaderTest,
InstallsOnGuestProfile) { … }
#endif
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
IN_PROC_BROWSER_TEST_F(EmbeddedA11yExtensionLoaderTest,
InstallsExtensionOnLacros) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
const auto& profiles = profile_manager->GetLoadedProfiles();
ASSERT_GT(profiles.size(), 0u);
Profile* profile = profiles[0];
InstallAndWaitForExtensionLoaded(
profile, extension_misc::kEmbeddedA11yHelperExtensionId,
extension_misc::kEmbeddedA11yHelperExtensionPath,
extension_misc::kEmbeddedA11yHelperManifestFilename,
true);
RemoveAndWaitForExtensionUnloaded(
profile, extension_misc::kEmbeddedA11yHelperExtensionId);
}
#endif