Send all updates from the PolicyService on the same loop iteration.
Update notifications were being sent in a posted task, after
OnPolicyServiceInitialized had been sent in a previous task. This made the
ConfigurationPolicyPrefStore unblock the PrefService initialization even
though it hadn't received the updated policies yet.
This CL removes a quick fix that was introduced for that, and posts the
notification that a policy provider has been updated instead.
BUG=263728
Review URL: https://chromiumcodereview.appspot.com/21527002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215047 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/policy/mock_configuration_policy_provider.cc b/chrome/browser/policy/mock_configuration_policy_provider.cc
index 06657cde..364e9aba 100644
--- a/chrome/browser/policy/mock_configuration_policy_provider.cc
+++ b/chrome/browser/policy/mock_configuration_policy_provider.cc
@@ -7,6 +7,8 @@
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "chrome/browser/policy/policy_bundle.h"
namespace policy {
@@ -21,6 +23,8 @@
bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
.CopyFrom(policy);
UpdatePolicy(bundle.Pass());
+ if (base::MessageLoop::current())
+ base::RunLoop().RunUntilIdle();
}
MockConfigurationPolicyObserver::MockConfigurationPolicyObserver() {}