#include "chrome/browser/ui/views/sharing/sharing_browsertest.h"
#include <map>
#include <string_view>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/sharing/sharing_service_factory.h"
#include "chrome/browser/sync/device_info_sync_service_factory.h"
#include "chrome/browser/sync/test/integration/sessions_helper.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/toolbar_button_provider.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "components/gcm_driver/fake_gcm_profile_service.h"
#include "components/sharing_message/proto/sharing_message.pb.h"
#include "components/sharing_message/sharing_device_registration_result.h"
#include "components/sharing_message/sharing_device_source_sync.h"
#include "components/sharing_message/sharing_fcm_sender.h"
#include "components/sharing_message/sharing_message_sender.h"
#include "components/sharing_message/sharing_utils.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync_device_info/device_info.h"
#include "components/sync_device_info/device_info_sync_service.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
void FakeWebPushSender::SendMessage(const std::string& fcm_token,
crypto::ECPrivateKey* vapid_key,
WebPushMessage message,
WebPushCallback callback) { … }
void FakeSharingMessageBridge::SendSharingMessage(
std::unique_ptr<sync_pb::SharingMessageSpecifics> specifics,
CommitFinishedCallback on_commit_callback) { … }
base::WeakPtr<syncer::DataTypeControllerDelegate>
FakeSharingMessageBridge::GetControllerDelegate() { … }
SharingBrowserTest::SharingBrowserTest()
: … { … }
SharingBrowserTest::~SharingBrowserTest() = default;
void SharingBrowserTest::SetUpOnMainThread() { … }
void SharingBrowserTest::Init(
sync_pb::SharingSpecificFields_EnabledFeatures first_device_feature,
sync_pb::SharingSpecificFields_EnabledFeatures second_device_feature) { … }
void SharingBrowserTest::SetUpDevices(
sync_pb::SharingSpecificFields_EnabledFeatures first_device_feature,
sync_pb::SharingSpecificFields_EnabledFeatures second_device_feature) { … }
void SharingBrowserTest::RegisterDevice(
int profile_index,
sync_pb::SharingSpecificFields_EnabledFeatures feature) { … }
void SharingBrowserTest::AddDeviceInfo(
const syncer::DeviceInfo& original_device,
int fake_device_id) { … }
std::unique_ptr<TestRenderViewContextMenu> SharingBrowserTest::InitContextMenu(
const GURL& url,
std::string_view link_text,
std::string_view selection_text) { … }
void SharingBrowserTest::CheckLastReceiver(
const SharingTargetDeviceInfo& device) const { … }
components_sharing_message::SharingMessage
SharingBrowserTest::GetLastSharingMessageSent() const { … }
SharingService* SharingBrowserTest::sharing_service() const { … }
content::WebContents* SharingBrowserTest::web_contents() const { … }
PageActionIconView* SharingBrowserTest::GetPageActionIconView(
PageActionIconType type) { … }