Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bded1b8a09f9ce321fbc67780e2e0af2bd01921f |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/policy/login_policy_test_base.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2015 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_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |
| +#define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/files/scoped_temp_dir.h" |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| + |
| +namespace base { |
| +class FilePath; |
| +} |
| + |
| +namespace policy { |
| + |
| +class LocalPolicyTestServer; |
| + |
| +// This class can be used to implement tests which need policy to be set prior |
| +// to login. |
| +class LoginPolicyTestBase : public chromeos::OobeBaseTest { |
| + protected: |
| + LoginPolicyTestBase(); |
| + ~LoginPolicyTestBase() override; |
| + |
| + // chromeos::OobeBaseTest:: |
| + void SetUp() override; |
| + void SetUpCommandLine(base::CommandLine* command_line) override; |
| + void SetUpOnMainThread() override; |
| + |
| + virtual base::DictionaryValue* GetMandatoryPoliciesValue() const; |
|
bartfab (slow)
2015/04/02 13:29:31
Nit 1: Forward-declare base::DictionaryValue.
Nit
peletskyi
2015/04/02 15:24:50
Done.
|
| + virtual base::DictionaryValue* GetRecommendedPoliciesValue() const; |
| + |
| + void SkipToLoginScreen(); |
| + void LogIn(const std::string& user_id, const std::string& password); |
| + |
| + static const char kAccountPassword[]; |
| + static const char kAccountId[]; |
| + |
| + private: |
| + void SetUpGaiaServerWithAccessTokens(); |
| + void SetMergeSessionParams(const std::string& email); |
| + void SetServerPolicy(); |
| + base::FilePath PolicyFilePath() const; |
| + |
| + scoped_ptr<LocalPolicyTestServer> test_server_; |
| + base::ScopedTempDir temp_dir_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LoginPolicyTestBase); |
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |