DescriptionEliminate 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
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251336
Patch Set 1 #
Total comments: 2
Patch Set 2 : Response to review #Patch Set 3 : Fix compile #
Messages
Total messages: 19 (0 generated)
|