#include "third_party/blink/renderer/core/fragment_directive/text_fragment_handler.h"
#include <gtest/gtest.h>
#include "base/containers/span.h"
#include "base/feature_list.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_font_face_descriptors.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mouse_event_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview_string.h"
#include "third_party/blink/renderer/core/css/css_font_face.h"
#include "third_party/blink/renderer/core/css/font_face_set_document.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/location.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink {
RunPendingTasks;
class TextFragmentHandlerTest : public SimTest { … };
TEST_F(TextFragmentHandlerTest, RemoveTextFragments) { … }
TEST_F(TextFragmentHandlerTest,
ExtractTextFragmentWithWithMultipleTextFragments) { … }
TEST_F(TextFragmentHandlerTest, ExtractTextFragmentWithNoMatch) { … }
TEST_F(TextFragmentHandlerTest, ExtractTextFragmentWithRange) { … }
TEST_F(TextFragmentHandlerTest, ExtractTextFragmentWithRangeAndContext) { … }
TEST_F(TextFragmentHandlerTest, ExtractFirstTextFragmentRect) { … }
TEST_F(TextFragmentHandlerTest, ExtractFirstTextFragmentRectScroll) { … }
TEST_F(TextFragmentHandlerTest, ExtractFirstTextFragmentRectMultipleHighlight) { … }
TEST_F(TextFragmentHandlerTest,
ExtractFirstTextFragmentRectMultipleHighlightWithNoFoundText) { … }
TEST_F(TextFragmentHandlerTest, RejectExtractFirstTextFragmentRect) { … }
TEST_F(TextFragmentHandlerTest, CheckPreemptiveGeneration) { … }
TEST_F(TextFragmentHandlerTest, CheckNoPreemptiveGenerationBlocklist) { … }
TEST_F(TextFragmentHandlerTest, CheckNoPreemptiveGenerationEditable) { … }
TEST_F(TextFragmentHandlerTest, SecondGenerationCrash) { … }
TEST_F(TextFragmentHandlerTest, CheckMetrics_Success) { … }
TEST_F(TextFragmentHandlerTest, CheckMetrics_Failure) { … }
TEST_F(TextFragmentHandlerTest,
ShouldCreateTextFragmentHandlerAndRemoveHighlightForIframes) { … }
TEST_F(TextFragmentHandlerTest, NonMatchingTextDirectiveCreatesHandler) { … }
TEST_F(TextFragmentHandlerTest, MatchingTextDirectiveCreatesHandler) { … }
TEST_F(TextFragmentHandlerTest,
ShouldCreateTextFragmentHandlerAndRemoveHighlight) { … }
TEST_F(TextFragmentHandlerTest,
ShouldCreateTextFragmentHandlerAndRequestSelector) { … }
TEST_F(TextFragmentHandlerTest,
ShouldRemoveFromMainFrameAndIframeWhenBothHaveHighlights) { … }
TEST_F(TextFragmentHandlerTest, IfGeneratorResetShouldRecordCorrectError) { … }
TEST_F(TextFragmentHandlerTest, NotGenerated) { … }
TEST_F(TextFragmentHandlerTest, InvalidateOverflowOnRemoval) { … }
}