OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/policy/enterprise_install_attributes.h" | 5 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void SetAttribute( | 50 void SetAttribute( |
51 cryptohome::SerializedInstallAttributes* install_attrs_proto, | 51 cryptohome::SerializedInstallAttributes* install_attrs_proto, |
52 const std::string& name, | 52 const std::string& name, |
53 const std::string& value) { | 53 const std::string& value) { |
54 cryptohome::SerializedInstallAttributes::Attribute* attribute; | 54 cryptohome::SerializedInstallAttributes::Attribute* attribute; |
55 attribute = install_attrs_proto->add_attributes(); | 55 attribute = install_attrs_proto->add_attributes(); |
56 attribute->set_name(name); | 56 attribute->set_name(name); |
57 attribute->set_value(value); | 57 attribute->set_value(value); |
58 } | 58 } |
59 | 59 |
60 MessageLoopForUI message_loop_; | 60 base::MessageLoopForUI message_loop_; |
61 base::ScopedTempDir temp_dir_; | 61 base::ScopedTempDir temp_dir_; |
62 scoped_ptr<chromeos::CryptohomeLibrary> cryptohome_; | 62 scoped_ptr<chromeos::CryptohomeLibrary> cryptohome_; |
63 scoped_ptr<chromeos::CryptohomeClient> stub_cryptohome_client_; | 63 scoped_ptr<chromeos::CryptohomeClient> stub_cryptohome_client_; |
64 EnterpriseInstallAttributes install_attributes_; | 64 EnterpriseInstallAttributes install_attributes_; |
65 | 65 |
66 EnterpriseInstallAttributes::LockResult LockDeviceAndWaitForResult( | 66 EnterpriseInstallAttributes::LockResult LockDeviceAndWaitForResult( |
67 const std::string& user, | 67 const std::string& user, |
68 DeviceMode device_mode, | 68 DeviceMode device_mode, |
69 const std::string& device_id) { | 69 const std::string& device_id) { |
70 base::RunLoop loop; | 70 base::RunLoop loop; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 ASSERT_EQ(static_cast<int>(blob.size()), | 201 ASSERT_EQ(static_cast<int>(blob.size()), |
202 file_util::WriteFile(GetTempPath(), blob.c_str(), blob.size())); | 202 file_util::WriteFile(GetTempPath(), blob.c_str(), blob.size())); |
203 install_attributes_.ReadCacheFile(GetTempPath()); | 203 install_attributes_.ReadCacheFile(GetTempPath()); |
204 EXPECT_EQ(DEVICE_MODE_ENTERPRISE, install_attributes_.GetMode()); | 204 EXPECT_EQ(DEVICE_MODE_ENTERPRISE, install_attributes_.GetMode()); |
205 EXPECT_EQ(kTestDomain, install_attributes_.GetDomain()); | 205 EXPECT_EQ(kTestDomain, install_attributes_.GetDomain()); |
206 EXPECT_EQ(kTestUser, install_attributes_.GetRegistrationUser()); | 206 EXPECT_EQ(kTestUser, install_attributes_.GetRegistrationUser()); |
207 EXPECT_EQ("", install_attributes_.GetDeviceId()); | 207 EXPECT_EQ("", install_attributes_.GetDeviceId()); |
208 } | 208 } |
209 | 209 |
210 } // namespace policy | 210 } // namespace policy |
OLD | NEW |