New issue
Advanced search Search tips

Issue 746647 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

display::Screen lifetime issue in ShellDesktopControllerAuraTest

Project Member Reported by ccameron@chromium.org, Jul 19 2017

Issue description

The ShellDesktopControllerAuraTest test (InputEvents, in particular), create an aura::WindowTreeHost that out-lives the display::Screen.

In particular, the display::Screen is reset with the stack
  display::Screen::SetScreenInstance()
  extensions::ShellDesktopControllerAura::DestroyRootWindow()
  extensions::ShellDesktopControllerAura::~ShellDesktopControllerAura()
  extensions::ShellDesktopControllerAura::~ShellDesktopControllerAura()
  extensions::ShellDesktopControllerAuraTest::TearDown()

Shortly thereafter, we try to destroy an aura::WindowTreeHost at
  aura::WindowTreeHost::~WindowTreeHost()
  aura::WindowTreeHostX11::~WindowTreeHostX11()
  aura::WindowTreeHostX11::~WindowTreeHostX11()
  aura::test::AuraTestHelper::TearDown()
  aura::test::AuraTestBase::TearDown()
  extensions::ShellDesktopControllerAuraTest::TearDown()

The aura::WindowTreeHost regularly reaches into display::Screen, and is also now an observer to display changes.

This puts us in the messy situation of trying to un-become a DisplayObserver after display::Screen has been destroyed.
 
One simple fix for this is to move being a DisplayObserver into the relevant sub-classes of DesktopWindowTreeHostWin and DesktopWindowTreeHostX11.

I may go for that solution, once the immediate fix in https://chromium-review.googlesource.com/c/577721/ lands.

Sign in to add a comment