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_AFFILIATION_TEST_HELPER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATION_TEST_HELPER_H_ | |
7 | |
8 #include <set> | |
9 #include <string> | |
10 #include "components/policy/core/common/cloud/policy_builder.h" | |
11 | |
12 namespace policy { | |
13 class DevicePolicyCrosTestHelper; | |
14 } // namespace policy | |
15 | |
16 namespace base { | |
17 class CommandLine; | |
18 } // namespace base | |
19 | |
20 namespace chromeos { | |
21 | |
22 class FakeSessionManagerClient; | |
23 | |
24 namespace affiliation_test_helper { | |
25 | |
26 // Creates policy key file for the user specified in |user_policy|. | |
27 // 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
| |
28 // boilerplate in other places. | |
29 void SetUserKeys(policy::UserPolicyBuilder* user_policy); | |
30 | |
31 // Sets device affiliation ID to |fake_session_manager| from | |
32 // |device_affiliation_ids| and modifies |test_helper| so that it contains | |
33 // correct values of device affiliation IDs for future use. To add some device | |
34 // 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.
| |
35 // modified by this function. | |
36 void SetDeviceAffiliationID( | |
37 policy::DevicePolicyCrosTestHelper* test_helper, | |
38 FakeSessionManagerClient* fake_session_manager_client, | |
39 const std::set<std::string>& device_affiliation_ids); | |
40 | |
41 // Sets user affiliation ID for |user_name| to |fake_session_manager| from | |
42 // |user_affiliation_ids| and modifies |user_policy| so that it contains | |
43 // correct values of user affiliation IDs for future use. To add user policies | |
44 // and have user affiliation IDs valid please use |user_policy| modified by this | |
45 // function. | |
46 void SetUserAffiliationIDs( | |
47 policy::UserPolicyBuilder* user_policy, | |
48 FakeSessionManagerClient* fake_session_manager_client, | |
49 const std::string& user_email, | |
50 const std::set<std::string>& user_affiliation_ids); | |
51 | |
52 // Registers the user with the given |user_id| on the device and marks OOBE | |
53 // as completed. This method should be called in PRE_* test. | |
54 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
| |
55 | |
56 // 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.
| |
57 void LoginUser(const std::string& user_id); | |
58 | |
59 // Set necessary for login command line switches. Execute it in | |
60 // SetUpCommandLine(). | |
61 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.
| |
62 | |
63 extern const char kFakeRefreshToken[]; | |
64 extern const char kEnterpriseUser[]; | |
65 | |
66 } // namespace affiliation_test_helper | |
67 | |
68 } // namespace chromeos | |
69 | |
70 #endif // CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATION_TEST_HELPER_H_ | |
OLD | NEW |