chromium/chrome/browser/media/router/presentation/presentation_service_delegate_impl_unittest.cc

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

#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h"

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/test/mock_callback.h"
#include "build/build_config.h"
#include "chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory.h"
#include "chrome/browser/media/router/test/provider_test_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/media_router/browser/media_router_factory.h"
#include "components/media_router/browser/presentation/local_presentation_manager.h"
#include "components/media_router/browser/presentation/local_presentation_manager_factory.h"
#include "components/media_router/browser/presentation/web_contents_presentation_manager.h"
#include "components/media_router/browser/test/mock_media_router.h"
#include "components/media_router/browser/test/mock_screen_availability_listener.h"
#include "components/media_router/common/media_source.h"
#include "components/media_router/common/pref_names.h"
#include "components/media_router/common/route_request_result.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/presentation_observer.h"
#include "content/public/browser/presentation_request.h"
#include "content/public/browser/presentation_screen_availability_listener.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/web_contents_tester.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "url/origin.h"

PresentationConnection;
PresentationConnectionMessage;
PresentationConnectionResultPtr;
PresentationInfo;
_;
Invoke;
Mock;
NiceMock;
Return;
StrictMock;
WithArgs;

namespace {

constexpr char kPresentationUrl1[] =;
constexpr char kPresentationUrl2[] =;
constexpr char kPresentationUrl3[] =;
constexpr char kFrameUrl[] =;
constexpr char kPresentationId[] =;

// Matches blink::mojom::PresentationInfo.
MATCHER_P(InfoEquals, expected, "") {}

}  // namespace

namespace media_router {

class MockDelegateObserver
    : public content::PresentationServiceDelegate::Observer {};

class MockWebContentsPresentationObserver
    : public content::PresentationObserver {};

class MockCreatePresentationConnectionCallbacks {};

class MockLocalPresentationManager : public LocalPresentationManager {};

std::unique_ptr<KeyedService> BuildMockLocalPresentationManager(
    content::BrowserContext* context) {}

// TODO(crbug.com/40753746): move p_s_d_impl_unittest.cc to the same directory
// as presentation_service_delegate_impl.* files.
class PresentationServiceDelegateImplTest
    : public ChromeRenderViewHostTestHarness {};

TEST_F(PresentationServiceDelegateImplTest, AddScreenAvailabilityListener) {}

TEST_F(PresentationServiceDelegateImplTest, AddMultipleListenersToFrame) {}

TEST_F(PresentationServiceDelegateImplTest, AddSameListenerTwice) {}

TEST_F(PresentationServiceDelegateImplTest, AddListenerForInvalidUrl) {}

TEST_F(PresentationServiceDelegateImplTest, SetDefaultPresentationUrl) {}

TEST_F(PresentationServiceDelegateImplTest, DefaultPresentationUrlCallback) {}

TEST_F(PresentationServiceDelegateImplTest, NotifyDefaultPresentationChanged) {}

TEST_F(PresentationServiceDelegateImplTest, NotifyMediaRoutesChanged) {}

TEST_F(PresentationServiceDelegateImplTest, ListenForConnectionStateChange) {}

TEST_F(PresentationServiceDelegateImplTest, GetMediaRoutes) {}

TEST_F(PresentationServiceDelegateImplTest, Reset) {}

TEST_F(PresentationServiceDelegateImplTest, DelegateObservers) {}

TEST_F(PresentationServiceDelegateImplTest, SinksObserverCantRegister) {}

TEST_F(PresentationServiceDelegateImplTest,
       TestCloseConnectionForLocalPresentation) {}

TEST_F(PresentationServiceDelegateImplTest,
       TestReconnectPresentationForLocalPresentation) {}

TEST_F(PresentationServiceDelegateImplTest, ConnectToLocalPresentation) {}

TEST_F(PresentationServiceDelegateImplTest, ConnectToPresentation) {}

#if !BUILDFLAG(IS_ANDROID)
TEST_F(PresentationServiceDelegateImplTest, AutoJoinRequest) {}
#endif  // !BUILDFLAG(IS_ANDROID)

}  // namespace media_router