#include "components/user_education/webui/help_bubble_handler.h"
#include <memory>
#include <vector>
#include "base/callback_list.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "components/user_education/common/help_bubble_factory_registry.h"
#include "components/user_education/common/help_bubble_params.h"
#include "components/user_education/test/test_help_bubble.h"
#include "components/user_education/webui/help_bubble_webui.h"
#include "components/user_education/webui/tracked_element_webui.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/web_ui_controller.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/base/interaction/expect_call_in_scope.h"
#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom-forward.h"
#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom-shared.h"
#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom.h"
namespace user_education {
namespace {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(…);
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(…);
constexpr gfx::RectF kElementBounds{ … };
class MockHelpBubbleClient : public help_bubble::mojom::HelpBubbleClient { … };
class TestHelpBubbleHandler : public HelpBubbleHandlerBase { … };
MATCHER_P(MatchesHelpBubbleParams, expected, "") { … }
}
class HelpBubbleHandlerTest : public testing::Test { … };
TEST_F(HelpBubbleHandlerTest, StartsWithNoElement) { … }
TEST_F(HelpBubbleHandlerTest, ElementCreatedOnEvent) { … }
TEST_F(HelpBubbleHandlerTest, ElementHiddenOnEvent) { … }
TEST_F(HelpBubbleHandlerTest, ElementActivatedOnEvent) { … }
TEST_F(HelpBubbleHandlerTest, ElementCustomEventOnEvent) { … }
TEST_F(HelpBubbleHandlerTest, MultipleIdentifiers) { … }
TEST_F(HelpBubbleHandlerTest, ShowHelpBubble) { … }
TEST_F(HelpBubbleHandlerTest, ShowHelpBubbleTwice) { … }
TEST_F(HelpBubbleHandlerTest, ShowHelpBubbleWithButtonsAndProgress) { … }
TEST_F(HelpBubbleHandlerTest, FocusHelpBubble) { … }
TEST_F(HelpBubbleHandlerTest, ExternalHelpBubbleUpdated) { … }
TEST_F(HelpBubbleHandlerTest, HelpBubbleClosedWhenVisibilityChanges) { … }
TEST_F(HelpBubbleHandlerTest, HelpBubbleClosedWhenClosedRemotely) { … }
TEST_F(HelpBubbleHandlerTest, DestroyHandlerCleansUpElement) { … }
TEST_F(HelpBubbleHandlerTest, DestroyBubbleWrapperClosesHelpBubble) { … }
TEST_F(HelpBubbleHandlerTest, HelpBubbleClosedWhenClosedByUserCallsDismiss) { … }
TEST_F(HelpBubbleHandlerTest, ButtonPressedCallsCallback) { … }
TEST_F(HelpBubbleHandlerTest, ShowMultipleBubblesAndCloseOneViaVisibility) { … }
TEST_F(HelpBubbleHandlerTest, ShowMultipleBubblesAndCloseOneViaCallback) { … }
TEST_F(HelpBubbleHandlerTest, WebContentsNotVisibleResultsInNoElement) { … }
TEST_F(HelpBubbleHandlerTest, WebContentsVisibilityNotAvailable) { … }
TEST_F(HelpBubbleHandlerTest, ElementShownOnmWebContentsBecomingVisible) { … }
TEST_F(HelpBubbleHandlerTest, ElementHiddenWebContentsBecomingInvisible) { … }
TEST_F(HelpBubbleHandlerTest, ElementHiddenWebContentsBecomingUnknown) { … }
TEST_F(HelpBubbleHandlerTest, RepeatedlyQueriesVisibility) { … }
TEST_F(HelpBubbleHandlerTest, WebContentsVisibilityCanChangeMultipleTimes) { … }
TEST_F(HelpBubbleHandlerTest, DestroyHandlerDuringCallback) { … }
TEST_F(HelpBubbleHandlerTest,
WebUIHelpBubblePreventsHideWhenVisibilityChanges) { … }
}