#include <memory>
#include <string>
#include "base/base64url.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/browser/cloud/user_policy_signin_service_base.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/policy/core/common/cloud/test/policy_builder.h"
#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_switches.h"
#include "components/policy/core/common/policy_test_utils.h"
#include "components/policy/proto/chrome_extension_policy.pb.h"
#include "components/policy/proto/cloud_policy.pb.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "components/policy/test_support/client_storage.h"
#include "components/policy/test_support/embedded_policy_test_server.h"
#include "components/policy/test_support/policy_storage.h"
#include "components/signin/public/base/signin_metrics.h"
#include "components/signin/public/base/signin_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/extension.h"
#include "extensions/test/extension_test_message_listener.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_switches.h"
#include "chrome/browser/ash/policy/core/user_cloud_policy_manager_ash.h"
#else
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/signin/public/identity_manager/primary_account_mutator.h"
#endif
_;
InvokeWithoutArgs;
Mock;
Return;
em;
namespace policy {
namespace {
const char kDMToken[] = …;
const char kDeviceID[] = …;
const char kTestExtension[] = …;
const base::FilePath::CharType kTestExtensionPath[] = …);
const char kTestPolicy[] = …;
const char kTestExtension2[] = …;
const base::FilePath::CharType kTestExtension2Path[] = …);
const char kTestPolicyJSON[] = …;
const char kTestPolicy2[] = …;
const char kTestPolicy2JSON[] = …;
}
class ComponentCloudPolicyTest : public extensions::ExtensionBrowserTest { … };
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_FetchExtensionPolicy …
#else
#define MAYBE_FetchExtensionPolicy …
#endif
IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, MAYBE_FetchExtensionPolicy) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_UpdateExtensionPolicy …
#else
#define MAYBE_UpdateExtensionPolicy …
#endif
IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, MAYBE_UpdateExtensionPolicy) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_InstallNewExtension …
#else
#define MAYBE_InstallNewExtension …
#endif
IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, MAYBE_InstallNewExtension) { … }
#if !BUILDFLAG(IS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, SignOutAndBackIn) { … }
#endif
class KeyRotationComponentCloudPolicyTest : public ComponentCloudPolicyTest { … };
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_Basic …
#else
#define MAYBE_Basic …
#endif
IN_PROC_BROWSER_TEST_F(KeyRotationComponentCloudPolicyTest, MAYBE_Basic) { … }
}