Chromium Code Reviews| Index: chrome/browser/chromeos/policy/affiliation_test_helper.h |
| diff --git a/chrome/browser/chromeos/policy/affiliation_test_helper.h b/chrome/browser/chromeos/policy/affiliation_test_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8e944f063b08632ed0686c104e585424a7b0a897 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/policy/affiliation_test_helper.h |
| @@ -0,0 +1,70 @@ |
| +// 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_AFFILIATION_TEST_HELPER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATION_TEST_HELPER_H_ |
| + |
| +#include <set> |
| +#include <string> |
| +#include "components/policy/core/common/cloud/policy_builder.h" |
| + |
| +namespace policy { |
| +class DevicePolicyCrosTestHelper; |
| +} // namespace policy |
| + |
| +namespace base { |
| +class CommandLine; |
| +} // namespace base |
| + |
| +namespace chromeos { |
| + |
| +class FakeSessionManagerClient; |
| + |
| +namespace affiliation_test_helper { |
| + |
| +// Creates policy key file for the user specified in |user_policy|. |
| +// todo peletskyi@: Replace pointer with const reference and replace this |
|
Andrew T Wilson (Slow)
2015/09/16 15:02:06
nit: wrong format for TODO. Also, this is a new AP
peletskyi
2015/09/21 14:17:24
Why not change it now? Because UserPolicyBuilder h
|
| +// boilerplate in other places. |
| +void SetUserKeys(policy::UserPolicyBuilder* user_policy); |
| + |
| +// Sets device affiliation ID to |fake_session_manager| from |
| +// |device_affiliation_ids| and modifies |test_helper| so that it contains |
| +// correct values of device affiliation IDs for future use. To add some device |
| +// policies and have device affiliation ID valid please use |test_helper| |
|
Andrew T Wilson (Slow)
2015/09/16 15:02:05
How should the reader know what they should be doi
peletskyi
2015/09/21 14:17:24
Done.
|
| +// modified by this function. |
| +void SetDeviceAffiliationID( |
| + policy::DevicePolicyCrosTestHelper* test_helper, |
| + FakeSessionManagerClient* fake_session_manager_client, |
| + const std::set<std::string>& device_affiliation_ids); |
| + |
| +// Sets user affiliation ID for |user_name| to |fake_session_manager| from |
| +// |user_affiliation_ids| and modifies |user_policy| so that it contains |
| +// correct values of user affiliation IDs for future use. To add user policies |
| +// and have user affiliation IDs valid please use |user_policy| modified by this |
| +// function. |
| +void SetUserAffiliationIDs( |
| + policy::UserPolicyBuilder* user_policy, |
| + FakeSessionManagerClient* fake_session_manager_client, |
| + const std::string& user_email, |
| + const std::set<std::string>& user_affiliation_ids); |
| + |
| +// Registers the user with the given |user_id| on the device and marks OOBE |
| +// as completed. This method should be called in PRE_* test. |
| +void PreLoginUser(const std::string& user_id); |
|
Andrew T Wilson (Slow)
2015/09/16 15:02:06
Why isn't this part of LoginUser()? Why does it ha
peletskyi
2015/09/21 14:17:24
It must be called in PRE_* functions.
Why we can't
|
| + |
| +// Log in user with |user_id|. User should be registered using RegisterUser(). |
|
Andrew T Wilson (Slow)
2015/09/16 15:02:06
What is RegisterUser()?
peletskyi
2015/09/21 14:17:24
Done.
|
| +void LoginUser(const std::string& user_id); |
| + |
| +// Set necessary for login command line switches. Execute it in |
| +// SetUpCommandLine(). |
| +void AppendCommandLineSwitches(base::CommandLine* command_line); |
|
Andrew T Wilson (Slow)
2015/09/16 15:02:06
Maybe name this something like AppendCommandLineSw
peletskyi
2015/09/21 14:17:24
Done.
|
| + |
| +extern const char kFakeRefreshToken[]; |
| +extern const char kEnterpriseUser[]; |
| + |
| +} // namespace affiliation_test_helper |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATION_TEST_HELPER_H_ |