Commit 1ee888ae authored by Andrew Wilson's avatar Andrew Wilson Committed by Commit Bot

Clear the testing provider on shutdown.

Restore code to clean up the test instance of the PolicyProvider, so unit tests
that set the PolicyProvider no longer crash when run in succession.

Bug: None
Test: Run unit_tests --gtest_filter=ProfilePolicyConnectorTest*
Change-Id: I3a90fb04f3736c7e1351791b52886d726913aeed
Reviewed-on: https://chromium-review.googlesource.com/893098Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Commit-Queue: Drew Wilson <atwilson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532865}
parent 088c8c59
......@@ -60,6 +60,9 @@ void BrowserPolicyConnectorBase::Shutdown() {
for (const auto& provider : *policy_providers_)
provider->Shutdown();
}
// Drop g_testing_provider so that tests executed with --single_process can
// call SetPolicyProviderForTesting() again. It is still owned by the test.
g_testing_provider = nullptr;
g_created_policy_service = false;
}
......
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