OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| 14 |
| 15 namespace base { |
| 16 class FilePath; |
| 17 class DictionaryValue; |
| 18 } |
| 19 |
| 20 namespace policy { |
| 21 |
| 22 class LocalPolicyTestServer; |
| 23 |
| 24 // This class can be used to implement tests which need policy to be set prior |
| 25 // to login. |
| 26 class LoginPolicyTestBase : public chromeos::OobeBaseTest { |
| 27 protected: |
| 28 LoginPolicyTestBase(); |
| 29 ~LoginPolicyTestBase() override; |
| 30 |
| 31 // chromeos::OobeBaseTest:: |
| 32 void SetUp() override; |
| 33 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 34 void SetUpOnMainThread() override; |
| 35 |
| 36 virtual scoped_ptr<base::DictionaryValue> GetMandatoryPoliciesValue() const; |
| 37 virtual scoped_ptr<base::DictionaryValue> GetRecommendedPoliciesValue() const; |
| 38 |
| 39 void SkipToLoginScreen(); |
| 40 void LogIn(const std::string& user_id, const std::string& password); |
| 41 |
| 42 static const char kAccountPassword[]; |
| 43 static const char kAccountId[]; |
| 44 |
| 45 private: |
| 46 void SetUpGaiaServerWithAccessTokens(); |
| 47 void SetMergeSessionParams(const std::string& email); |
| 48 void SetServerPolicy(); |
| 49 base::FilePath PolicyFilePath() const; |
| 50 |
| 51 scoped_ptr<LocalPolicyTestServer> test_server_; |
| 52 base::ScopedTempDir temp_dir_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(LoginPolicyTestBase); |
| 55 }; |
| 56 |
| 57 } // namespace policy |
| 58 |
| 59 #endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_ |
OLD | NEW |