Commit 5c8e13b1 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Partial revert of 5529bc63

Using false for |by_user| for slide out breaks a lot of
NotificationDelegates. We'll have to find another fix.

Bug: 805208,822248
Change-Id: Ic56783427354b96f74ac393b7bcd07380eadfda5
Reviewed-on: https://chromium-review.googlesource.com/966891
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544842}
parent f19a924e
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
...@@ -30,8 +29,6 @@ ...@@ -30,8 +29,6 @@
#include "ui/message_center/fake_message_center.h" #include "ui/message_center/fake_message_center.h"
#include "ui/message_center/public/cpp/message_center_constants.h" #include "ui/message_center/public/cpp/message_center_constants.h"
#include "ui/message_center/views/desktop_popup_alignment_delegate.h" #include "ui/message_center/views/desktop_popup_alignment_delegate.h"
#include "ui/message_center/views/message_view.h"
#include "ui/message_center/views/slide_out_controller.h"
#include "ui/message_center/views/toast_contents_view.h" #include "ui/message_center/views/toast_contents_view.h"
#include "ui/views/test/views_test_base.h" #include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
...@@ -102,8 +99,6 @@ class MessagePopupCollectionTest : public views::ViewsTestBase { ...@@ -102,8 +99,6 @@ class MessagePopupCollectionTest : public views::ViewsTestBase {
protected: protected:
MessagePopupCollection* collection() { return collection_.get(); } MessagePopupCollection* collection() { return collection_.get(); }
int GetDeferCounter() { return collection_->defer_counter_; }
size_t GetToastCounts() { size_t GetToastCounts() {
return collection_->toasts_.size(); return collection_->toasts_.size();
} }
...@@ -144,15 +139,6 @@ class MessagePopupCollectionTest : public views::ViewsTestBase { ...@@ -144,15 +139,6 @@ class MessagePopupCollectionTest : public views::ViewsTestBase {
return NULL; return NULL;
} }
void SlideOutToast(const std::string& id) {
ui::ScopedAnimationDurationScaleMode zero_duration_scope(
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION);
ui::GestureEventDetails details(ui::ET_SCROLL_FLING_START, 1000.0f, 0.f);
ui::GestureEvent event(0, 0, ui::EF_NONE, ui::EventTimeForNow(), details);
static_cast<MessageView*>(GetToast(id)->child_at(0))
->slide_out_controller_.OnGestureEvent(&event);
}
std::string AddNotification() { std::string AddNotification() {
std::string id = base::IntToString(id_++); std::string id = base::IntToString(id_++);
std::unique_ptr<Notification> notification = std::make_unique<Notification>( std::unique_ptr<Notification> notification = std::make_unique<Notification>(
...@@ -836,18 +822,5 @@ TEST_F(MessagePopupCollectionTest, AddedAndRemovedAtSameTime) { ...@@ -836,18 +822,5 @@ TEST_F(MessagePopupCollectionTest, AddedAndRemovedAtSameTime) {
} }
#endif #endif
TEST_F(MessagePopupCollectionTest, RemoveBySlide) {
std::string id = AddNotification();
WaitForTransitionsDone();
EXPECT_EQ(0, GetDeferCounter());
EXPECT_EQ(1u, GetToastCounts());
SlideOutToast(id);
WaitForTransitionsDone();
EXPECT_EQ(0, GetDeferCounter());
EXPECT_EQ(0u, GetToastCounts());
}
} // namespace test } // namespace test
} // namespace message_center } // namespace message_center
...@@ -284,7 +284,7 @@ void MessageView::OnSlideOut() { ...@@ -284,7 +284,7 @@ void MessageView::OnSlideOut() {
notification_id_, true /* mark_notification_as_read */); notification_id_, true /* mark_notification_as_read */);
} else { } else {
MessageCenter::Get()->RemoveNotification(notification_id_, MessageCenter::Get()->RemoveNotification(notification_id_,
false /* by_user */); true /* by_user */);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment