Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: ui/message_center/views/message_popup_collection_unittest.cc

Issue 2075953003: mash: Convert WebNotificationTray to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@statusarea
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/message_center/views/message_popup_collection_unittest.cc
diff --git a/ui/message_center/views/message_popup_collection_unittest.cc b/ui/message_center/views/message_popup_collection_unittest.cc
index 3de515c5a7204a28d7e00ae468089e74cf5bdc82..e2f40a69c89a2ada31e8d51d62bb38012f5d990d 100644
--- a/ui/message_center/views/message_popup_collection_unittest.cc
+++ b/ui/message_center/views/message_popup_collection_unittest.cc
@@ -46,6 +46,27 @@ std::unique_ptr<message_center::Notification> CreateTestNotification(
new message_center::NotificationDelegate()));
}
+// Provides an aura window context for widget creation.
+class TestPopupAlignmentDelegate
+ : public message_center::DesktopPopupAlignmentDelegate {
+ public:
+ explicit TestPopupAlignmentDelegate(gfx::NativeWindow context)
+ : context_(context) {}
+ ~TestPopupAlignmentDelegate() override {}
+
+ // PopupAlignmentDelegate:
+ void ConfigureWidgetInitParamsForContainer(
+ views::Widget* widget,
+ views::Widget::InitParams* init_params) override {
+ init_params->context = context_;
+ }
+
+ private:
+ gfx::NativeWindow context_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestPopupAlignmentDelegate);
+};
+
} // namespace
namespace message_center {
@@ -57,9 +78,9 @@ class MessagePopupCollectionTest : public views::ViewsTestBase {
views::ViewsTestBase::SetUp();
MessageCenter::Initialize();
MessageCenter::Get()->DisableTimersForTest();
- alignment_delegate_.reset(new DesktopPopupAlignmentDelegate);
- collection_.reset(new MessagePopupCollection(
- GetContext(), MessageCenter::Get(), NULL, alignment_delegate_.get()));
+ alignment_delegate_.reset(new TestPopupAlignmentDelegate(GetContext()));
+ collection_.reset(new MessagePopupCollection(MessageCenter::Get(), NULL,
+ alignment_delegate_.get()));
// This size fits test machines resolution and also can keep a few toasts
// w/o ill effects of hitting the screen overflow. This allows us to assume
// and verify normal layout of the toast stack.
« no previous file with comments | « ui/message_center/views/message_popup_collection.cc ('k') | ui/message_center/views/popup_alignment_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698