Eliminate potential for flaky crash in BCKSFactory::SetTestingFactory().
BCKSFactory::SetTestingFactory() calls BCKSFactory::BrowserContextShutdown(), which a BCKSFactory subclass may override to perform operations that result in BrowserContextDependencyManager::AssertBrowserContextWasntDestroyed() being called (e.g., BCKSFactory::GetServiceForContext()). When used with TestingProfile::Builder, BCKSFactory::SetTestingFactory() is called *before* the TestingProfile calls BrowserContextDependencyManager::CreateBrowserContextServicesForTest(). These facts set up the potential for a flaky crash: if the BrowserContext instance being used is at the same address as one that had been used in a previous test, then the call to AssertBrowserContextWasntDestroyed() will raise an error. This CL eliminates the potential for that crash by explicitly informing BrowserContextDependencyManager that the BrowserContext instance being used in BCKSFactory::SetTestingFactory() is live. NOTRY=true Review URL: https://codereview.chromium.org/159763004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251336 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment