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

Side by Side Diff: chrome/browser/chromeos/settings/stub_install_attributes.cc

Issue 2737733003: Add Active Directory login UI tests (Closed)
Patch Set: Created 3 years, 9 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
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 #include "chrome/browser/chromeos/settings/stub_install_attributes.h" 5 #include "chrome/browser/chromeos/settings/stub_install_attributes.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 10 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 void StubInstallAttributes::SetEnterprise(const std::string& domain, 32 void StubInstallAttributes::SetEnterprise(const std::string& domain,
33 const std::string& device_id) { 33 const std::string& device_id) {
34 registration_mode_ = policy::DEVICE_MODE_ENTERPRISE; 34 registration_mode_ = policy::DEVICE_MODE_ENTERPRISE;
35 registration_domain_ = domain; 35 registration_domain_ = domain;
36 registration_realm_.clear(); 36 registration_realm_.clear();
37 registration_device_id_ = device_id; 37 registration_device_id_ = device_id;
38 } 38 }
39 39
40 void StubInstallAttributes::SetActiveDirectoryEnterprise(
41 const std::string& realm) {
42 registration_mode_ = policy::DEVICE_MODE_ENTERPRISE_AD;
43 registration_realm_ = realm;
44 registration_domain_.clear();
45 }
46
40 // static 47 // static
41 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateUnset() { 48 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateUnset() {
42 StubInstallAttributes* attributes = new StubInstallAttributes(); 49 StubInstallAttributes* attributes = new StubInstallAttributes();
43 attributes->Clear(); 50 attributes->Clear();
44 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( 51 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
45 attributes); 52 attributes);
46 return ScopedStubInstallAttributes(); 53 return ScopedStubInstallAttributes();
47 } 54 }
48 55
49 // static 56 // static
50 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateConsumer() { 57 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateConsumer() {
51 StubInstallAttributes* attributes = new StubInstallAttributes(); 58 StubInstallAttributes* attributes = new StubInstallAttributes();
52 attributes->SetConsumer(); 59 attributes->SetConsumer();
53 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( 60 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
54 attributes); 61 attributes);
55 return ScopedStubInstallAttributes(); 62 return ScopedStubInstallAttributes();
56 } 63 }
57 64
58 // static 65 // static
59 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateEnterprise( 66 ScopedStubInstallAttributes ScopedStubInstallAttributes::CreateEnterprise(
60 const std::string& domain, 67 const std::string& domain,
61 const std::string& device_id) { 68 const std::string& device_id) {
62 StubInstallAttributes* attributes = new StubInstallAttributes(); 69 StubInstallAttributes* attributes = new StubInstallAttributes();
63 attributes->SetEnterprise(domain, device_id); 70 attributes->SetEnterprise(domain, device_id);
64 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( 71 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
65 attributes); 72 attributes);
66 return ScopedStubInstallAttributes(); 73 return ScopedStubInstallAttributes();
67 } 74 }
68 75
76 // static
77 ScopedStubInstallAttributes
78 ScopedStubInstallAttributes::CreateActiveDirectoryEnterprise(
79 const std::string& realm) {
80 StubInstallAttributes* attributes = new StubInstallAttributes();
81 attributes->SetActiveDirectoryEnterprise(realm);
82 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
83 attributes);
84 return ScopedStubInstallAttributes();
85 }
86
69 ScopedStubInstallAttributes::ScopedStubInstallAttributes() { 87 ScopedStubInstallAttributes::ScopedStubInstallAttributes() {
70 } 88 }
71 89
72 ScopedStubInstallAttributes::~ScopedStubInstallAttributes() { 90 ScopedStubInstallAttributes::~ScopedStubInstallAttributes() {
73 policy::BrowserPolicyConnectorChromeOS::RemoveInstallAttributesForTesting(); 91 policy::BrowserPolicyConnectorChromeOS::RemoveInstallAttributesForTesting();
74 } 92 }
75 93
76 } // namespace chromeos 94 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698