chromium/chrome/browser/renderer_context_menu/link_to_text_menu_observer_interactive_uitest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/enterprise/data_controls/desktop_data_controls_dialog_test_helper.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_context_menu/link_to_text_menu_observer.h"
#include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/toasts/toast_controller.h"
#include "chrome/browser/ui/toasts/toast_features.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/enterprise/data_controls/core/browser/features.h"
#include "components/enterprise/data_controls/core/browser/test_utils.h"
#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
#include "components/shared_highlighting/core/common/shared_highlighting_metrics.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/process_manager.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/clipboard/clipboard.h"

class MockLinkToTextMenuObserver : public LinkToTextMenuObserver {};

namespace {

class LinkToTextMenuObserverTest : public extensions::ExtensionBrowserTest {};

LinkToTextMenuObserverTest::~LinkToTextMenuObserverTest() = default;

class LinkToTextMenuObserverDataControlsTest
    : public LinkToTextMenuObserverTest {};

}  // namespace

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, AddsCopyMenuItem) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, AddsCopyAndRemoveMenuItems) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, CopiesLinkToText) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, CopiesLinkForEmptySelector) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, ReplacesRefInURL) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, InvalidSelectorForIframe) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, HiddenForExtensions) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, Blocklist) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       SelectionOverlappingHighlightCopiesNewLinkToText) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationCopiedLinkTypeMetric_NewGeneration) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationCopiedLinkTypeMetric_ReShare) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationRequestedMetric_Success_NoDelay) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationRequestedMetric_Success_WithDelay) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationRequestedMetric_Failure_NoDelay) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       LinkGenerationRequestedMetric_Failure_WithDelay) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       CopiesLinkToTextWithExistingFragments) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest,
                       CopiesLinkToTextWithExistingFragmentsWithTextSelection) {}

IN_PROC_BROWSER_TEST_F(
    LinkToTextMenuObserverTest,
    CopiesLinkToTextWithExistingFragmentsWithMultipleTextSelections) {}

IN_PROC_BROWSER_TEST_F(
    LinkToTextMenuObserverTest,
    CopiesLinkToTextWithExistingFragmentsWithExistingRefAndTextSelections) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverDataControlsTest,
                       BlocksCopyingLinkToText) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverDataControlsTest,
                       WarnsCopyingLinkToTextAndCancel) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverDataControlsTest,
                       WarnsCopyingLinkToTextAndBypass) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverDataControlsTest,
                       ReplacesCopyingLinkToText) {}

IN_PROC_BROWSER_TEST_F(LinkToTextMenuObserverTest, ShowsToastOnCopyingLink) {}