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

Unified Diff: chrome/browser/chromeos/policy/login_policy_test_base.h

Issue 1150373002: platformKeys: Add policy and corporate key tagging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@key_perm
Patch Set: Created 5 years, 6 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/chromeos/policy/login_policy_test_base.h
diff --git a/chrome/browser/chromeos/policy/login_policy_test_base.h b/chrome/browser/chromeos/policy/login_policy_test_base.h
index cf4f8480dcc7c173ea7a57bd57af19ff618ea427..ab07a117f1380f29665dd5771b05856c7e26a813 100644
--- a/chrome/browser/chromeos/policy/login_policy_test_base.h
+++ b/chrome/browser/chromeos/policy/login_policy_test_base.h
@@ -21,6 +21,34 @@ namespace policy {
class LocalPolicyTestServer;
+class PolicyTestHelper {
+ public:
+ PolicyTestHelper(const std::string& user_email,
+ const base::DictionaryValue& mandatory,
+ const base::DictionaryValue& recommended);
+ virtual ~PolicyTestHelper();
+
+ void UpdateCommandLine(base::CommandLine* command_line);
+ void WaitForInitialPolicy(Profile* profile);
+ void UpdatePolicy(Profile* profile,
+ const base::DictionaryValue& mandatory,
+ const base::DictionaryValue& recommended);
+
+ static const char kAccountId[];
+
+ private:
+ void SetServerPolicy(const base::DictionaryValue& mandatory,
+ const base::DictionaryValue& recommended);
+ base::FilePath PolicyFilePath() const;
+
+ const std::string user_email_;
+ base::ScopedTempDir temp_dir_;
+ scoped_ptr<LocalPolicyTestServer> test_server_;
+
+ DISALLOW_COPY_AND_ASSIGN(PolicyTestHelper);
+};
+
+
// This class can be used to implement tests which need policy to be set prior
// to login.
class LoginPolicyTestBase : public chromeos::OobeBaseTest {
@@ -44,12 +72,9 @@ class LoginPolicyTestBase : public chromeos::OobeBaseTest {
private:
void SetUpGaiaServerWithAccessTokens();
- void SetMergeSessionParams(const std::string& email);
- void SetServerPolicy();
- base::FilePath PolicyFilePath() const;
+ void SetMergeSessionParams();
- scoped_ptr<LocalPolicyTestServer> test_server_;
- base::ScopedTempDir temp_dir_;
+ scoped_ptr<PolicyTestHelper> policy_helper_;
DISALLOW_COPY_AND_ASSIGN(LoginPolicyTestBase);
};

Powered by Google App Engine
This is Rietveld 408576698