wm::CanActivateWindow(window) returns true for a to-be-destroyed window in unittests. |
|||
Issue descriptionChrome Version: (copy from chrome://version) OS: Chrome In tests environment, if a window is to be destroyed, it should not be regarded as activatable any more. However, currently in OnWindowDestroying(window), the to-be-destroyed window is still visible and is regarded as activatable, i.e., wm::CanActivateWindow(window) still returns true in this case, which cause MRUWindowTracker not get a correct window list to cycle through. NOTE: only happens in tests environment
,
Oct 20 2017
,
Oct 20 2017
Re sky: Thanks! Shall we change TestWindowDelegate to handle this? In Window destructor, it will call WindowDelegate::OnWindowDestroying() first and then notify its observers. Maybe we should the window first in TestWindowDelegate::OnWindowDestroying()? (Actually I tried to do this in TestWindowDelegate::OnWindowDestroying(), but it broke a lot of unittests which I could not figure out why. So instead to modify TestWindowDelegate, I created a customized subclass overriding TestWindowDelegate to handle my test cases as a workaround. But I don't know if it's an issue that we should fix it in a general place)
,
Oct 24 2017
What specific tests are failing? I'm inclined to make the test explicitly hide the window first. I suspect it isn't necessary to do this in TestWindowDelegate, rather from the test itself.
,
Oct 24 2017
Currently there is no test failing because of this. But with my CL https://chromium-review.googlesource.com/c/chromium/src/+/734809 in place, several unittests in split_view_controller_unittest.cc and window_selector_unittest.cc are failing. The reason is in SplitViewController::OnWindowDestroying(window), it's possible that it will start the overview mode. MRU window list is calculated here to decide which window should be put in overview window grid. The to-be-destroyed window should not put in the MRU window list otherwise it will cause crash when the overview window grid tries to access the window. As you suggested, I created a customized TestWindowDelegate and override OnWindowDestroying() to hide the window first to fix these tests. If it's unnecessary to (or should not) do this in TestWindowDelegate, I'll close this issue then.
,
Oct 27 2017
Close this. |
|||
►
Sign in to add a comment |
|||
Comment 1 by sky@chromium.org
, Oct 20 2017