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

Unified Diff: ui/views/focus/focus_traversal_unittest.cc

Issue 2483083002: Fix leak in FocusManager tests (Closed)
Patch Set: ifdef for mac Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_traversal_unittest.cc
diff --git a/ui/views/focus/focus_traversal_unittest.cc b/ui/views/focus/focus_traversal_unittest.cc
index 529e96d34d821e2528803e6d6205ae9dda727652..7a43eef857d3ed05941fa4da830310a637eb231e 100644
--- a/ui/views/focus/focus_traversal_unittest.cc
+++ b/ui/views/focus/focus_traversal_unittest.cc
@@ -137,7 +137,14 @@ class BorderView : public NativeViewHost {
SetFocusBehavior(FocusBehavior::NEVER);
}
- ~BorderView() override {}
+ ~BorderView() override {
+ // TODO: ifdef should not be necessary. NativeWidgetMac has different
+ // ownership semantics: http://crbug.com/663418.
+#if !defined(OS_MACOSX)
+ if (widget_)
+ widget_->CloseNow();
+#endif
+ }
virtual internal::RootView* GetContentsRootView() {
return static_cast<internal::RootView*>(widget_->GetRootView());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698