#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
namespace policy {
namespace {
const char kAutoplayTestPageURL[] = …;
const char kUnifiedAutoplayTestPageURL[] = …;
}
class AutoplayPolicyTest : public PolicyTest { … };
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, AutoplayAllowedByPolicy) { … }
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, CrossOriginIframe) { … }
#if BUILDFLAG(IS_LINUX)
#define MAYBE_AutoplayAllowlist_Allowed …
#else
#define MAYBE_AutoplayAllowlist_Allowed …
#endif
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, MAYBE_AutoplayAllowlist_Allowed) { … }
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, AutoplayAllowlist_PatternAllowed) { … }
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, AutoplayAllowlist_Missing) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_AutoplayDeniedByPolicy …
#else
#define MAYBE_AutoplayDeniedByPolicy …
#endif
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, MAYBE_AutoplayDeniedByPolicy) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_AutoplayDeniedAllowedWithURL …
#else
#define MAYBE_AutoplayDeniedAllowedWithURL …
#endif
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest, MAYBE_AutoplayDeniedAllowedWithURL) { … }
IN_PROC_BROWSER_TEST_F(AutoplayPolicyTest,
DISABLED_AutoplayAllowedGlobalAndURL) { … }
class AutoplayPolicyFencedFrameTest : public AutoplayPolicyTest { … };
IN_PROC_BROWSER_TEST_F(AutoplayPolicyFencedFrameTest, AutoplayAllowedByPolicy) { … }
IN_PROC_BROWSER_TEST_F(AutoplayPolicyFencedFrameTest,
AutoplayAllowlist_Allowed) { … }
}