Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: chrome/browser/policy/cloud_policy_browsertest.cc

Issue 12209070: Fix cloud policy duplicate registrations issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/cloud_policy_browsertest.cc
diff --git a/chrome/browser/policy/cloud_policy_browsertest.cc b/chrome/browser/policy/cloud_policy_browsertest.cc
index 7f60752daca242a902cfd54e64df459a5fff6f21..78be44b8d085250b24a5e5d70007f5ef7fa08cfb 100644
--- a/chrome/browser/policy/cloud_policy_browsertest.cc
+++ b/chrome/browser/policy/cloud_policy_browsertest.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/proto/chrome_settings.pb.h"
#include "chrome/browser/policy/proto/cloud_policy.pb.h"
+#include "chrome/browser/policy/test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_notification_types.h"
@@ -137,19 +138,8 @@ class CloudPolicyTest : public InProcessBrowserTest {
}
virtual void SetUpOnMainThread() OVERRIDE {
- // Checks that no policies have been loaded by the other providers before
- // setting up the cloud connection. Other policies configured in the test
- // machine will interfere with these tests.
- const PolicyMap& map = g_browser_process->policy_service()->GetPolicies(
- PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
- if (!map.empty()) {
- base::DictionaryValue dict;
- for (PolicyMap::const_iterator it = map.begin(); it != map.end(); ++it)
- dict.SetWithoutPathExpansion(it->first, it->second.value->DeepCopy());
- ADD_FAILURE()
- << "There are pre-existing policies in this machine that will "
- << "interfere with these tests. Policies found: " << dict;
- }
+ ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service()))
+ << "Pre-existing policies in this machine will make this test fail.";
BrowserPolicyConnector* connector =
g_browser_process->browser_policy_connector();
« no previous file with comments | « no previous file | chrome/browser/policy/cloud_policy_client.h » ('j') | chrome/browser/policy/cloud_policy_manager_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698