#include <memory>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_timeouts.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_enums.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
#include "chrome/browser/ui/tabs/tab_utils.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/switches.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/gl/gl_switches.h"
#include "url/url_constants.h"
namespace extensions {
namespace {
constexpr char kExtensionId[] = …;
constexpr char kValidChromeURL[] = …;
class TabCaptureApiTest : public ExtensionApiTest { … };
class TabCaptureApiPixelTest : public TabCaptureApiTest { … };
#if BUILDFLAG(IS_MAC) || defined(MEMORY_SANITIZER)
#define MAYBE_ApiTests …
#else
#define MAYBE_ApiTests …
#endif
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_ApiTests) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest,
DISABLED_EndToEndWithoutRemoting) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest, DISABLED_EndToEndThroughWebRTC) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, GetUserMediaTest) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_ActiveTabPermission) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_FullscreenEvents …
#elif defined(MEMORY_SANITIZER)
#define MAYBE_FullscreenEvents …
#else
#define MAYBE_FullscreenEvents …
#endif
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_FullscreenEvents) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, GrantForChromePages) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, CaptureInSplitIncognitoMode) { … }
#if BUILDFLAG(IS_LINUX) || defined(MEMORY_SANITIZER)
#define MAYBE_Constraints …
#else
#define MAYBE_Constraints …
#endif
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { … }
#if defined(MEMORY_SANITIZER)
#define MAYBE_TabIndicator …
#else
#define MAYBE_TabIndicator …
#endif
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_TabIndicator) { … }
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MultipleExtensions) { … }
}
}