chromium/ui/message_center/views/message_popup_collection_unittest.cc

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

#include "ui/message_center/views/message_popup_collection.h"

#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/accessibility/ax_node.h"
#include "ui/display/display.h"
#include "ui/events/base_event_utils.h"
#include "ui/gfx/animation/linear_animation.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/message_center_constants.h"
#include "ui/message_center/public/cpp/notification_types.h"
#include "ui/message_center/views/desktop_message_popup_collection.h"
#include "ui/message_center/views/message_popup_view.h"
#include "ui/message_center/views/notification_view.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/test/views_test_base.h"

MessageCenter;
Notification;

namespace message_center {

namespace {

class MockMessagePopupView;

class MockMessagePopupCollection : public DesktopMessagePopupCollection {};

class MockMessagePopupView : public MessagePopupView {};

MessagePopupView* MockMessagePopupCollection::CreatePopup(
    const Notification& notification) {}

}  // namespace

class MessagePopupCollectionTest : public views::ViewsTestBase,
                                   public MessageCenterObserver {};

TEST_F(MessagePopupCollectionTest, Nothing) {}

TEST_F(MessagePopupCollectionTest, FadeInFadeOutNotification) {}

TEST_F(MessagePopupCollectionTest, FadeInMultipleNotifications) {}

TEST_F(MessagePopupCollectionTest, UpdateContents) {}

// TODO(crbug.com/40885754): Flaky on all platforms.
TEST_F(MessagePopupCollectionTest, DISABLED_UpdateContentsCausesPopupClose) {}

TEST_F(MessagePopupCollectionTest, OnChildNotificationViewUpdated) {}

TEST_F(MessagePopupCollectionTest, MessageCenterVisibility) {}

TEST_F(MessagePopupCollectionTest, ShowCustomOnPrimaryDisplay) {}

TEST_F(MessagePopupCollectionTest, NotShowCustomOnSubDisplay) {}

TEST_F(MessagePopupCollectionTest, MixedFullscreenShow) {}

TEST_F(MessagePopupCollectionTest, MixedFullscreenBlock) {}

TEST_F(MessagePopupCollectionTest, NotificationsMoveDown) {}

TEST_F(MessagePopupCollectionTest, PopupResized) {}

TEST_F(MessagePopupCollectionTest, ExpandLatest) {}

TEST_F(MessagePopupCollectionTest, ExpandLatestWithMoveDown) {}

TEST_F(MessagePopupCollectionTest, HoverClose) {}

// Popup timers should be paused if a notification has focus.
// Once the focus is lost or the notification is resumed, popup timers
// should restart.
TEST_F(MessagePopupCollectionTest, FocusedClose) {}

TEST_F(MessagePopupCollectionTest, SlideOutClose) {}

TEST_F(MessagePopupCollectionTest, TooTallNotification) {}

TEST_F(MessagePopupCollectionTest, DisplaySizeChanged) {}

TEST_F(MessagePopupCollectionTest, PopupResizedAndOverflown) {}

TEST_F(MessagePopupCollectionTest, DismissOnClick) {}

TEST_F(MessagePopupCollectionTest, NotDismissedOnClick) {}

TEST_F(MessagePopupCollectionTest, PopupCollectionBounds) {}

TEST_F(MessagePopupCollectionTest, PopupCollectionHeightChanged) {}

// Tests that `MessagePopupCollection` notifies when there is an incoming silent
// notification.
TEST_F(MessagePopupCollectionTest, NotifySilentNotification) {}

TEST_F(MessagePopupCollectionTest, DefaultPositioning) {}

TEST_F(MessagePopupCollectionTest, DefaultPositioningWithRightTaskbar) {}

TEST_F(MessagePopupCollectionTest, TopDownPositioningWithTopTaskbar) {}

TEST_F(MessagePopupCollectionTest, TopDownPositioningWithLeftAndTopTaskbar) {}

TEST_F(MessagePopupCollectionTest, TopDownPositioningWithBottomAndTopTaskbar) {}

TEST_F(MessagePopupCollectionTest, LeftPositioningWithLeftTaskbar) {}

TEST_F(MessagePopupCollectionTest, PopupWidgetClosedOutsideDuringFadeOut) {}

TEST_F(MessagePopupCollectionTest, NotifyPopupClosedThenCloseAllPopups) {}

// Notification removing may occur while the animation triggered by the previous
// operation is running. As result, notification is removed from the message
// center but its popup is still kept. At this moment, a new notification with
// the same notification id may be added to the message center. This can happen
// on Chrome OS when an external display is connected with the Chromebook device
// (see https://crbug.com/921402). This test case emulates the procedure of
// the external display connection that is mentioned in the link above. Verifies
// that under this circumstance the notification popup is updated.
TEST_F(MessagePopupCollectionTest, RemoveNotificationWhileAnimating) {}

TEST_F(MessagePopupCollectionTest, AccessibileAttributes) {}

}  // namespace message_center