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

Unified Diff: trunk/src/ui/views/widget/widget_unittest.cc

Issue 13565004: Revert 192525 "Context menu on views must show on mouse down for..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « trunk/src/ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/widget/widget_unittest.cc
===================================================================
--- trunk/src/ui/views/widget/widget_unittest.cc (revision 192531)
+++ trunk/src/ui/views/widget/widget_unittest.cc (working copy)
@@ -1715,40 +1715,5 @@
EXPECT_TRUE(delegate->is_top_level());
}
-// A scumbag View that deletes its owning widget OnMousePressed.
-class WidgetDeleterView : public View {
- public:
- WidgetDeleterView() : View() {}
-
- // Overridden from View.
- bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
- delete GetWidget();
- return true;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WidgetDeleterView);
-};
-
-TEST_F(WidgetTest, TestWidgetDeletedInOnMousePressed) {
- Widget* widget = new Widget;
- Widget::InitParams params =
- CreateParams(views::Widget::InitParams::TYPE_POPUP);
- params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- widget->Init(params);
-
- widget->SetContentsView(new WidgetDeleterView);
-
- widget->SetSize(gfx::Size(100, 100));
- widget->Show();
-
- gfx::Point click_location(45, 15);
- ui::MouseEvent press(ui::ET_MOUSE_PRESSED, click_location, click_location,
- ui::EF_LEFT_MOUSE_BUTTON);
- widget->OnMouseEvent(&press);
-
- // Yay we did not crash!
-}
-
} // namespace
} // namespace views
« no previous file with comments | « trunk/src/ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698