Commit 13d934bc authored by jonross's avatar jonross Committed by Commit bot

Update WindowManagerApplication teardown

WindowManagerApplication's normal destruction order involves tearing down
everything is has created.

However on some fast tests it is possible for WindowManagerApplication to be
destroyed before OnStart is ever called. When this occurs we attempt to destroy
services which we never created, and various DCHECKS are triggered.

PhishingDOMFeatureExtractorTest.SubframeRemoval has a >50% repro rate of this
locally where the crash occurs after the test successfully passes.

TEST=PhishingDOMFeatureExtractorTest.SubframeRemoval
BUG=678687

Review-Url: https://codereview.chromium.org/2851763002
Cr-Commit-Position: refs/heads/master@{#468101}
parent 9eb38116
...@@ -38,6 +38,11 @@ namespace mus { ...@@ -38,6 +38,11 @@ namespace mus {
WindowManagerApplication::WindowManagerApplication() {} WindowManagerApplication::WindowManagerApplication() {}
WindowManagerApplication::~WindowManagerApplication() { WindowManagerApplication::~WindowManagerApplication() {
// Verify that we created a WindowManager before attempting to tear everything
// down. In some fast running tests OnStart may never have been called.
if (!window_manager_.get())
return;
// Destroy the WindowManager while still valid. This way we ensure // Destroy the WindowManager while still valid. This way we ensure
// OnWillDestroyRootWindowController() is called (if it hasn't been already). // OnWillDestroyRootWindowController() is called (if it hasn't been already).
window_manager_.reset(); window_manager_.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment