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

Unified Diff: ui/views/test/widget_test.h

Issue 2875513003: cleanup: make WidgetClosingObserver as test support (Closed)
Patch Set: Created 3 years, 7 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 | « chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc ('k') | ui/views/test/widget_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/widget_test.h
diff --git a/ui/views/test/widget_test.h b/ui/views/test/widget_test.h
index 62be1b7e4c029723046169dedc36e728e442677b..a796a26f3c9a5bb9fb777d8c254fa2853de9e5c2 100644
--- a/ui/views/test/widget_test.h
+++ b/ui/views/test/widget_test.h
@@ -177,6 +177,24 @@ class WidgetActivationWaiter : public WidgetObserver {
DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter);
};
+// Use in tests to provide functionality to observe the widget passed in the
+// constructor for the widget closing event.
+class WidgetClosingObserver : public WidgetObserver {
+ public:
+ explicit WidgetClosingObserver(Widget* widget);
+ ~WidgetClosingObserver() override;
+
+ bool widget_closed() const { return !widget_; }
+
+ private:
+ // views::WidgetObserver override:
+ void OnWidgetClosing(Widget* widget) override;
+
+ Widget* widget_;
+
+ DISALLOW_COPY_AND_ASSIGN(WidgetClosingObserver);
+};
+
} // namespace test
} // namespace views
« no previous file with comments | « chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc ('k') | ui/views/test/widget_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698