-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-Clear-the-testing-provider-on-shutdown.patch
36 lines (31 loc) · 1.5 KB
/
0001-Clear-the-testing-provider-on-shutdown.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 758c8697e9cc63516130dd292f5cac499209d0c0 Mon Sep 17 00:00:00 2001
From: Andrew Wilson <[email protected]>
Date: Tue, 30 Jan 2018 14:47:47 +0000
Subject: [PATCH] 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/893098
Reviewed-by: Julian Pastarmov <[email protected]>
Commit-Queue: Drew Wilson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#532865}
---
components/policy/core/browser/browser_policy_connector_base.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/components/policy/core/browser/browser_policy_connector_base.cc b/components/policy/core/browser/browser_policy_connector_base.cc
index 35ce7605063d..cc9625f4f8af 100644
--- a/components/policy/core/browser/browser_policy_connector_base.cc
+++ b/components/policy/core/browser/browser_policy_connector_base.cc
@@ -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;
}
--
2.14.3