Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/chromeos/policy/device_policy_cros_browser_test.h

Issue 258743005: Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added arg to PathService::OverrideAndCreateIfNeeded, added test for FakeCryptohomeClient::InstallAt… Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/scoped_temp_dir.h"
11 #include "chrome/browser/chromeos/policy/device_policy_builder.h" 10 #include "chrome/browser/chromeos/policy/device_policy_builder.h"
12 #include "chrome/test/base/in_process_browser_test.h" 11 #include "chrome/test/base/in_process_browser_test.h"
13 #include "chromeos/dbus/fake_dbus_thread_manager.h" 12 #include "chromeos/dbus/fake_dbus_thread_manager.h"
14 13
15 namespace chromeos { 14 namespace chromeos {
16 class FakeSessionManagerClient; 15 class FakeSessionManagerClient;
17 } 16 }
18 17
19 namespace policy { 18 namespace policy {
20 19
21 class DevicePolicyCrosTestHelper { 20 class DevicePolicyCrosTestHelper {
22 public: 21 public:
23 DevicePolicyCrosTestHelper(); 22 DevicePolicyCrosTestHelper();
24 ~DevicePolicyCrosTestHelper(); 23 ~DevicePolicyCrosTestHelper();
25 24
26 // Marks the device as enterprise-owned. Must be called to make device 25 // Marks the device as enterprise-owned. Must be called to make device
27 // policies apply Chrome-wide. If this is not called, device policies will 26 // policies apply Chrome-wide. If this is not called, device policies will
28 // affect CrosSettings only. 27 // affect CrosSettings only.
29 void MarkAsEnterpriseOwned(); 28 void MarkAsEnterpriseOwned();
30 29
31 // Writes the owner key to disk. To be called before installing a policy. 30 // Writes the owner key to disk. To be called before installing a policy.
32 void InstallOwnerKey(); 31 void InstallOwnerKey();
33 32
34 DevicePolicyBuilder* device_policy() { return &device_policy_; } 33 DevicePolicyBuilder* device_policy() { return &device_policy_; }
35 34
36 private: 35 private:
37 // Stores the device owner key and the install attributes. 36 void OverridePaths();
38 base::ScopedTempDir temp_dir_;
39 37
40 // Carries Chrome OS device policies for tests. 38 // Carries Chrome OS device policies for tests.
41 DevicePolicyBuilder device_policy_; 39 DevicePolicyBuilder device_policy_;
42 40
43 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosTestHelper); 41 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosTestHelper);
44 }; 42 };
45 43
46 // Used to test Device policy changes in Chrome OS. 44 // Used to test Device policy changes in Chrome OS.
47 class DevicePolicyCrosBrowserTest : public InProcessBrowserTest { 45 class DevicePolicyCrosBrowserTest : public InProcessBrowserTest {
48 protected: 46 protected:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // FakeDBusThreadManager uses FakeSessionManagerClient. 78 // FakeDBusThreadManager uses FakeSessionManagerClient.
81 chromeos::FakeDBusThreadManager* fake_dbus_thread_manager_; 79 chromeos::FakeDBusThreadManager* fake_dbus_thread_manager_;
82 chromeos::FakeSessionManagerClient* fake_session_manager_client_; 80 chromeos::FakeSessionManagerClient* fake_session_manager_client_;
83 81
84 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosBrowserTest); 82 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosBrowserTest);
85 }; 83 };
86 84
87 } // namespace policy 85 } // namespace policy
88 86
89 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ 87 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698