Chromium Code Reviews| 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 1bf6ebccd3aa234598892b4d3ca8a172515acc18..afeaf97fb51b6b5a0e9b1d277dce00bbc60bdcb1 100644 |
| --- a/ui/views/focus/focus_traversal_unittest.cc |
| +++ b/ui/views/focus/focus_traversal_unittest.cc |
| @@ -137,7 +137,15 @@ class BorderView : public NativeViewHost { |
| SetFocusBehavior(FocusBehavior::NEVER); |
| } |
| - ~BorderView() override {} |
| + ~BorderView() override { |
| +#if !defined(OS_MACOSX) |
| + // TYPE_CONTROL Widget close order is different on macOS vs Windows/Linux. |
|
tapted
2016/11/07 06:14:50
We generally need platforms to behave the same - t
Patti Lor
2016/11/08 01:47:31
Deleted as discussed offline.
|
| + // On macOS, |widget_|'s native widget will be destroyed by the time this |
| + // destructor is reached, so avoid possible use-after-frees on it (see |
| + // Widget::CloseNow()) by calling this only on Windows and Linux. |
| + widget_->CloseNow(); |
| +#endif |
| + } |
| virtual internal::RootView* GetContentsRootView() { |
| return static_cast<internal::RootView*>(widget_->GetRootView()); |