Make ScopedProfileKeepAlive play nice in unit tests
In unit-tests, g_browser_process->profile_manager() can return null. When the DestroyProfileOnBrowserClose flag is enabled (via ScopedFeatureList, or fieldtrial_testing_config.json), ScopedProfileKeepAlive causes a crash. Add a guard in ScopedProfileKeepAlive(), so it's a no-op if there is no ProfileManager. Bug: 88586 Change-Id: Ife9f198da3d7dc69f8cf59bed80aca9c57517a6d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2614859 Auto-Submit: Nicolas Ouellet-Payeur <nicolaso@chromium.org> Commit-Queue: Mihai Sardarescu <msarda@chromium.org> Reviewed-by:Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#841088}
Showing
Please register or sign in to comment