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

Side by Side Diff: chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc

Issue 608283003: Remove retail mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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) 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/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 install_attributes_->ReadCacheFile(GetTempPath()); 164 install_attributes_->ReadCacheFile(GetTempPath());
165 EXPECT_EQ(std::string(), install_attributes_->GetDeviceId()); 165 EXPECT_EQ(std::string(), install_attributes_->GetDeviceId());
166 ASSERT_EQ(EnterpriseInstallAttributes::LOCK_SUCCESS, 166 ASSERT_EQ(EnterpriseInstallAttributes::LOCK_SUCCESS,
167 LockDeviceAndWaitForResult( 167 LockDeviceAndWaitForResult(
168 kTestUser, 168 kTestUser,
169 DEVICE_MODE_ENTERPRISE, 169 DEVICE_MODE_ENTERPRISE,
170 kTestDeviceId)); 170 kTestDeviceId));
171 EXPECT_EQ(kTestDeviceId, install_attributes_->GetDeviceId()); 171 EXPECT_EQ(kTestDeviceId, install_attributes_->GetDeviceId());
172 } 172 }
173 173
174 TEST_F(EnterpriseInstallAttributesTest, GetMode) {
175 install_attributes_->ReadCacheFile(GetTempPath());
176 EXPECT_EQ(DEVICE_MODE_PENDING, install_attributes_->GetMode());
177 ASSERT_EQ(EnterpriseInstallAttributes::LOCK_SUCCESS,
178 LockDeviceAndWaitForResult(
179 kTestUser,
180 DEVICE_MODE_RETAIL_KIOSK,
181 kTestDeviceId));
182 EXPECT_EQ(DEVICE_MODE_RETAIL_KIOSK,
183 install_attributes_->GetMode());
184 }
185
186 TEST_F(EnterpriseInstallAttributesTest, ConsumerDevice) { 174 TEST_F(EnterpriseInstallAttributesTest, ConsumerDevice) {
187 install_attributes_->ReadCacheFile(GetTempPath()); 175 install_attributes_->ReadCacheFile(GetTempPath());
188 EXPECT_EQ(DEVICE_MODE_PENDING, install_attributes_->GetMode()); 176 EXPECT_EQ(DEVICE_MODE_PENDING, install_attributes_->GetMode());
189 // Lock the attributes empty. 177 // Lock the attributes empty.
190 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize()); 178 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize());
191 base::RunLoop loop; 179 base::RunLoop loop;
192 install_attributes_->ReadImmutableAttributes(loop.QuitClosure()); 180 install_attributes_->ReadImmutableAttributes(loop.QuitClosure());
193 loop.Run(); 181 loop.Run();
194 182
195 ASSERT_FALSE(cryptohome_util::InstallAttributesIsFirstInstall()); 183 ASSERT_FALSE(cryptohome_util::InstallAttributesIsFirstInstall());
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 EnterpriseInstallAttributes::kAttrEnterpriseUser, kTestUser)); 266 EnterpriseInstallAttributes::kAttrEnterpriseUser, kTestUser));
279 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize()); 267 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize());
280 268
281 // Verify that EnterpriseInstallAttributes correctly decodes the stub 269 // Verify that EnterpriseInstallAttributes correctly decodes the stub
282 // cache file. 270 // cache file.
283 install_attributes_->ReadCacheFile(GetTempPath()); 271 install_attributes_->ReadCacheFile(GetTempPath());
284 EXPECT_EQ(kTestUser, install_attributes_->GetRegistrationUser()); 272 EXPECT_EQ(kTestUser, install_attributes_->GetRegistrationUser());
285 } 273 }
286 274
287 } // namespace policy 275 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698