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

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc

Issue 2838423003: Make sure challenging user keys doesn't work in signin profile. (Closed)
Patch Set: Rebased Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
index 01494f642ad35d1a5f59f2671f6c08f45be21589..c487110b815343ebaa1f936fcdb936aee5739932 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
@@ -409,8 +409,9 @@ class EPKPChallengeUserKeyTest : public EPKPChallengeKeyTestBase {
protected:
static const char kArgs[];
- EPKPChallengeUserKeyTest()
- : EPKPChallengeKeyTestBase(ProfileType::USER_PROFILE),
+ explicit EPKPChallengeUserKeyTest(
+ ProfileType profile_type = ProfileType::USER_PROFILE)
+ : EPKPChallengeKeyTestBase(profile_type),
impl_(&mock_cryptohome_client_,
&mock_async_method_caller_,
&mock_attestation_flow_,
@@ -423,8 +424,10 @@ class EPKPChallengeUserKeyTest : public EPKPChallengeKeyTestBase {
void SetUp() override {
EPKPChallengeKeyTestBase::SetUp();
- // Set the user preferences.
- prefs_->SetBoolean(prefs::kAttestationEnabled, true);
+ if (profile_type_ == ProfileType::USER_PROFILE) {
+ // Set the user preferences.
+ prefs_->SetBoolean(prefs::kAttestationEnabled, true);
+ }
}
// Returns an error string for the given code.
@@ -578,6 +581,19 @@ TEST_F(EPKPChallengeUserKeyTest, AttestationPreparedDbusFailed) {
utils::RunFunctionAndReturnError(func_.get(), kArgs, browser()));
}
+class EPKPChallengeUserKeySigninProfileTest : public EPKPChallengeUserKeyTest {
+ protected:
+ EPKPChallengeUserKeySigninProfileTest()
+ : EPKPChallengeUserKeyTest(ProfileType::SIGNIN_PROFILE) {}
+};
+
+TEST_F(EPKPChallengeUserKeySigninProfileTest, UserKeyNotAvailable) {
+ settings_helper_.SetBoolean(chromeos::kDeviceAttestationEnabled, false);
+
+ EXPECT_EQ(EPKPChallengeUserKey::kUserKeyNotAvailable,
+ utils::RunFunctionAndReturnError(func_.get(), kArgs, browser()));
+}
+
class EPKPChallengeMachineKeyUnmanagedUserTest
: public EPKPChallengeMachineKeyTest {
protected:
« no previous file with comments | « chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698