OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class DevicePolicyCrosTestHelper { | 22 class DevicePolicyCrosTestHelper { |
23 public: | 23 public: |
24 DevicePolicyCrosTestHelper(); | 24 DevicePolicyCrosTestHelper(); |
25 ~DevicePolicyCrosTestHelper(); | 25 ~DevicePolicyCrosTestHelper(); |
26 | 26 |
27 // Marks the device as enterprise-owned. Must be called to make device | 27 // Marks the device as enterprise-owned. Must be called to make device |
28 // policies apply Chrome-wide. If this is not called, device policies will | 28 // policies apply Chrome-wide. If this is not called, device policies will |
29 // affect CrosSettings only. | 29 // affect CrosSettings only. |
30 static void MarkAsEnterpriseOwnedBy(const std::string& user_name); | 30 static void MarkAsEnterpriseOwnedBy(const std::string& user_name); |
| 31 // Marks the device as Active Directory enterprise-owned. |
| 32 static void MarkAsActiveDirectoryEnterpriseOwned(const std::string& realm); |
31 void MarkAsEnterpriseOwned(); | 33 void MarkAsEnterpriseOwned(); |
32 | 34 |
33 // Writes the owner key to disk. To be called before installing a policy. | 35 // Writes the owner key to disk. To be called before installing a policy. |
34 void InstallOwnerKey(); | 36 void InstallOwnerKey(); |
35 | 37 |
36 DevicePolicyBuilder* device_policy() { return &device_policy_; } | 38 DevicePolicyBuilder* device_policy() { return &device_policy_; } |
37 | 39 |
38 private: | 40 private: |
39 static void OverridePaths(); | 41 static void OverridePaths(); |
40 | 42 |
41 // Carries Chrome OS device policies for tests. | 43 // Carries Chrome OS device policies for tests. |
42 DevicePolicyBuilder device_policy_; | 44 DevicePolicyBuilder device_policy_; |
43 | 45 |
44 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosTestHelper); | 46 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosTestHelper); |
45 }; | 47 }; |
46 | 48 |
47 // Used to test Device policy changes in Chrome OS. | 49 // Used to test Device policy changes in Chrome OS. |
48 class DevicePolicyCrosBrowserTest : public InProcessBrowserTest { | 50 class DevicePolicyCrosBrowserTest : public InProcessBrowserTest { |
49 protected: | 51 protected: |
50 DevicePolicyCrosBrowserTest(); | 52 DevicePolicyCrosBrowserTest(); |
51 ~DevicePolicyCrosBrowserTest() override; | 53 ~DevicePolicyCrosBrowserTest() override; |
52 | 54 |
53 void SetUpInProcessBrowserTestFixture() override; | 55 void SetUpInProcessBrowserTestFixture() override; |
54 void TearDownInProcessBrowserTestFixture() override; | 56 void TearDownInProcessBrowserTestFixture() override; |
55 | 57 |
| 58 virtual void MarkOwnership(); |
| 59 |
56 // Marks the device as enterprise-owned. Must be called to make device | 60 // Marks the device as enterprise-owned. Must be called to make device |
57 // policies apply Chrome-wide. If this is not called, device policies will | 61 // policies apply Chrome-wide. If this is not called, device policies will |
58 // affect CrosSettings only. | 62 // affect CrosSettings only. |
59 void MarkAsEnterpriseOwned(); | 63 void MarkAsEnterpriseOwned(); |
60 | 64 |
61 // Writes the owner key to disk. To be called before installing a policy. | 65 // Writes the owner key to disk. To be called before installing a policy. |
62 void InstallOwnerKey(); | 66 void InstallOwnerKey(); |
63 | 67 |
64 // Reinstalls |device_policy_| as the policy (to be used when it was | 68 // Reinstalls |device_policy_| as the policy (to be used when it was |
65 // recently changed). | 69 // recently changed). |
(...skipping 15 matching lines...) Expand all Loading... |
81 // FakeDBusThreadManager uses FakeSessionManagerClient. | 85 // FakeDBusThreadManager uses FakeSessionManagerClient. |
82 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter_; | 86 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter_; |
83 chromeos::FakeSessionManagerClient* fake_session_manager_client_; | 87 chromeos::FakeSessionManagerClient* fake_session_manager_client_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosBrowserTest); | 89 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosBrowserTest); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace policy | 92 } // namespace policy |
89 | 93 |
90 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ | 94 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |
OLD | NEW |