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..3ed28e4716c1bda3e26c8d4cea8ea3232d5f1b46 |
--- /dev/null |
+++ b/chrome/browser/chromeos/policy/login_policy_test_base.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
bartfab (slow)
2015/04/01 14:22:42
Nit: s/2014/2015/
peletskyi
2015/04/01 18:55:47
Done.
|
+// 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> |
bartfab (slow)
2015/04/01 14:22:43
Nit: Add blank line below.
peletskyi
2015/04/01 18:55:46
Done.
|
+#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 for the tests when policy needs to be set prior login. |
bartfab (slow)
2015/04/01 14:22:43
Nit: How about: "This class can be used to impleme
peletskyi
2015/04/01 18:55:46
Done.
|
+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 std::string GetMandatoryPolicies() const; |
bartfab (slow)
2015/04/01 14:22:43
Rather than expecting tests to manually construct
bartfab (slow)
2015/04/02 08:44:28
I still think it is the right thing to do this.
peletskyi
2015/04/02 12:53:29
Done.
|
+ virtual std::string GetRecommendedPolicies() 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; |
bartfab (slow)
2015/04/01 14:22:43
Nit: When declaring a member of this type (not a p
peletskyi
2015/04/01 18:55:46
Following styleguide we should use like forward de
bartfab (slow)
2015/04/02 08:44:28
Nice catch. I was not aware that for return types,
|
+ |
+ 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_ |
bartfab (slow)
2015/04/01 14:22:43
Nit: Add a blank line above.
peletskyi
2015/04/01 18:55:46
Done.
|