#include <stddef.h>
#include <memory>
#include <set>
#include <string_view>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/browsertest_util.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/menu_manager_test_observer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/channel_info.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/version_info/channel.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/browser/extension_host_test_helper.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/state_store.h"
#include "extensions/browser/state_store_test_observer.h"
#include "extensions/browser/test_management_policy.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/mojom/view_type.mojom.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "net/dns/mock_host_resolver.h"
#include "ui/base/models/menu_model.h"
WebContents;
ContextMenuMatcher;
ContextType;
MenuItem;
ResultCatcher;
MenuModel;
namespace {
constexpr char kPersistentExtensionId[] = …;
}
class ExtensionContextMenuBrowserTest
: public extensions::ExtensionBrowserTest { … };
class ExtensionContextMenuLazyTest
: public ExtensionContextMenuBrowserTest,
public testing::WithParamInterface<ContextType> { … };
class ExtensionContextMenuPersistentTest
: public ExtensionContextMenuBrowserTest { … };
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, Simple) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, PRE_Persistent) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, Persistent) { … }
IN_PROC_BROWSER_TEST_F(ExtensionContextMenuPersistentTest, UpdateOnclick) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest,
UpdateCheckedStateOfFirstRadioItem) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest,
UpdateCheckedStateOfNonfirstRadioItem) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, Patterns) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, LongTitle) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, TopLevel) { … }
static void ExpectLabelAndType(const char* expected_label,
MenuModel::ItemType expected_type,
const MenuModel& menu,
size_t index) { … }
static void VerifyMenuForSeparatorsTest(const MenuModel& menu) { … }
IN_PROC_BROWSER_TEST_F(ExtensionContextMenuPersistentTest, Separators) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, TargetURLs) { … }
ExtensionContextMenuSWTest;
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuSWTest, IncognitoSplit) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, Frames) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, ClickInFrame) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, StartEnabled) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, StartDisabled) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, EventPage) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#define MAYBE_IncognitoSplitContextMenuCount …
#else
#define MAYBE_IncognitoSplitContextMenuCount …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest,
MAYBE_IncognitoSplitContextMenuCount) { … }
IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, UpdateCheckboxes) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);