chromium/components/media_message_center/media_notification_view_impl_unittest.cc

// Copyright 2018 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_message_center/media_notification_view_impl.h"

#include <memory>

#include "base/containers/flat_set.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "components/media_message_center/media_notification_background_impl.h"
#include "components/media_message_center/media_notification_container.h"
#include "components/media_message_center/mock_media_notification_item.h"
#include "services/media_session/public/mojom/media_session.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/events/base_event_utils.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/message_center_constants.h"
#include "ui/message_center/views/notification_control_buttons_view.h"
#include "ui/message_center/views/notification_header_view.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/test/button_test_api.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/view_utils.h"

namespace media_message_center {

MediaSessionAction;
_;
Expectation;
Invoke;

namespace {

// The icons size is 24 and INSETS_VECTOR_IMAGE_BUTTON will add padding around
// the image.
const int kMediaButtonIconSize =;

// The title artist row should always have the same height.
const int kMediaTitleArtistRowExpectedHeight =;

const char16_t kTestDefaultAppName[] =;
const char16_t kTestAppName[] =;

const gfx::Size kWidgetSize(500, 500);

constexpr int kViewWidth =;
constexpr int kViewArtworkWidth =;
const gfx::Size kViewSize(kViewWidth, 400);

class MockMediaNotificationContainer : public MediaNotificationContainer {};

}  // namespace

class MediaNotificationViewImplTest : public views::ViewsTestBase {};

TEST_F(MediaNotificationViewImplTest, ButtonsSanityCheck) {}

#if BUILDFLAG(IS_WIN)
#define MAYBE_ButtonsFocusCheck
#else
#define MAYBE_ButtonsFocusCheck
#endif
TEST_F(MediaNotificationViewImplTest, MAYBE_ButtonsFocusCheck) {}

TEST_F(MediaNotificationViewImplTest, PlayPauseButtonTooltipCheck) {}

TEST_F(MediaNotificationViewImplTest, NextTrackButtonClick) {}

TEST_F(MediaNotificationViewImplTest, PlayButtonClick) {}

TEST_F(MediaNotificationViewImplTest, PauseButtonClick) {}

TEST_F(MediaNotificationViewImplTest, PreviousTrackButtonClick) {}

TEST_F(MediaNotificationViewImplTest, SeekBackwardButtonClick) {}

TEST_F(MediaNotificationViewImplTest, SeekForwardButtonClick) {}

TEST_F(MediaNotificationViewImplTest, PlayToggle_FromObserver_Empty) {}

TEST_F(MediaNotificationViewImplTest, PlayToggle_FromObserver_PlaybackState) {}

TEST_F(MediaNotificationViewImplTest, MetadataIsDisplayed) {}

TEST_F(MediaNotificationViewImplTest, UpdateMetadata_FromObserver) {}

TEST_F(MediaNotificationViewImplTest, UpdateMetadata_AppName) {}

TEST_F(MediaNotificationViewImplTest, Buttons_WhenCollapsed) {}

TEST_F(MediaNotificationViewImplTest, Buttons_WhenExpanded) {}

TEST_F(MediaNotificationViewImplTest, ClickHeader_ToggleExpand) {}

TEST_F(MediaNotificationViewImplTest, ActionButtonsHiddenByDefault) {}

TEST_F(MediaNotificationViewImplTest, ActionButtonsToggleVisibility) {}

TEST_F(MediaNotificationViewImplTest, UpdateArtworkFromItem) {}

TEST_F(MediaNotificationViewImplTest, ExpandableDefaultState) {}

TEST_F(MediaNotificationViewImplTest, ExpandablePlayPauseActionCountsOnce) {}

TEST_F(MediaNotificationViewImplTest, BecomeExpandableAndWasNotExpandable) {}

TEST_F(MediaNotificationViewImplTest, BecomeExpandableButWasAlreadyExpandable) {}

TEST_F(MediaNotificationViewImplTest, BecomeNotExpandableAndWasExpandable) {}

TEST_F(MediaNotificationViewImplTest,
       BecomeNotExpandableButWasAlreadyNotExpandable) {}

TEST_F(MediaNotificationViewImplTest, ActionButtonRowSizeAndAlignment) {}

TEST_F(MediaNotificationViewImplTest, NotifysContainerOfExpandedState) {}

TEST_F(MediaNotificationViewImplTest, AccessibleProperties) {}

TEST_F(MediaNotificationViewImplTest, ForcedExpandedState) {}

TEST_F(MediaNotificationViewImplTest, AllowsHidingOfAppIcon) {}

TEST_F(MediaNotificationViewImplTest, ClickHeader_NotifyContainer) {}

}  // namespace media_message_center