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

Unified Diff: chrome/browser/policy/policy_test_utils.h

Issue 23532033: policy: Add ostream operator overloads to policy types for testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: generate json Created 7 years, 3 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/policy_test_utils.h
diff --git a/chrome/browser/policy/policy_test_utils.h b/chrome/browser/policy/policy_test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a6409db4018bba3928c43a81f39d28bcefa9f2c
--- /dev/null
+++ b/chrome/browser/policy/policy_test_utils.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_
+#define CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_
+
+#include <ostream>
+
+#include "chrome/browser/policy/policy_map.h"
+#include "chrome/browser/policy/policy_service.h"
+#include "chrome/browser/policy/policy_types.h"
+
+namespace policy {
+
+class PolicyBundle;
+struct PolicyNamespace;
+
+// Returns true if |service| is not serving any policies. Otherwise logs the
+// current policies and returns false.
+bool PolicyServiceIsEmpty(const PolicyService* service);
+
+} // namespace policy
+
+std::ostream& operator<<(std::ostream& os, const policy::PolicyBundle& bundle);
+std::ostream& operator<<(std::ostream& os, policy::PolicyScope scope);
+std::ostream& operator<<(std::ostream& os, policy::PolicyLevel level);
+std::ostream& operator<<(std::ostream& os, policy::PolicyDomain domain);
+std::ostream& operator<<(std::ostream& os, const policy::PolicyMap& policies);
+std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e);
+std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns);
+
+#endif // CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_
« no previous file with comments | « chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc ('k') | chrome/browser/policy/policy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698