#include <stdint.h>
#include <string_view>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
#include "chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h"
#include "chrome/browser/extensions/api/extension_action/test_icon_image_observer.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/extension_action_test_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/overlay_window.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/video_picture_in_picture_window_controller.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/content_browser_test_utils.h"
#include "content/public/test/download_test_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_action.h"
#include "extensions/browser/extension_action_icon_factory.h"
#include "extensions/browser/extension_action_manager.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_host_test_helper.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/resource/resource_scale_factor.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_unittest_util.h"
WebContents;
namespace extensions {
namespace {
void ExecuteExtensionAction(Browser* browser, const Extension* extension) { … }
const char kEmptyImageDataError[] = …;
const char kEmptyPathError[] = …;
void VerifyIconsMatch(const gfx::Image& bar_rendering,
const gfx::Image& model_icon) { … }
ContextType;
class BrowserActionApiTest : public ExtensionApiTest { … };
class BrowserActionApiCanvasTest : public BrowserActionApiTest { … };
class BrowserActionApiTestWithContextType
: public BrowserActionApiTest,
public testing::WithParamInterface<ContextType> { … };
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, Basic) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, Disable) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, Enable) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, Update) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, UpdateSvg) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(BrowserActionApiCanvasTest, DynamicBrowserAction) { … }
IN_PROC_BROWSER_TEST_F(BrowserActionApiCanvasTest, InvisibleIconBrowserAction) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType,
TabSpecificBrowserActionState) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, SetIcon) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, AddPopup) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, RemovePopup) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, IncognitoBasic) { … }
#if defined(LEAK_SANITIZER)
#define MAYBE_IncognitoUpdate …
#else
#define MAYBE_IncognitoUpdate …
#endif
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType,
MAYBE_IncognitoUpdate) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, IncognitoSplit) { … }
IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, CloseBackgroundPage) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType,
BadgeBackgroundColor) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType, Getters) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType,
TestTriggerBrowserAction) { … }
IN_PROC_BROWSER_TEST_P(BrowserActionApiTestWithContextType,
WithRectangularIcon) { … }
IN_PROC_BROWSER_TEST_F(BrowserActionApiTest,
TestPictureInPictureOnBrowserActionIconClick) { … }
}
}