OLD | NEW |
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/extensions/api/enterprise_platform_keys/enterprise_plat
form_keys_api.h" | 5 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_plat
form_keys_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 return CreateArgsInternal(true); | 405 return CreateArgsInternal(true); |
406 } | 406 } |
407 | 407 |
408 std::unique_ptr<base::ListValue> CreateArgsNoRegister() { | 408 std::unique_ptr<base::ListValue> CreateArgsNoRegister() { |
409 return CreateArgsInternal(false); | 409 return CreateArgsInternal(false); |
410 } | 410 } |
411 | 411 |
412 std::unique_ptr<base::ListValue> CreateArgsInternal(bool register_key) { | 412 std::unique_ptr<base::ListValue> CreateArgsInternal(bool register_key) { |
413 std::unique_ptr<base::ListValue> args(new base::ListValue); | 413 std::unique_ptr<base::ListValue> args(new base::ListValue); |
414 args->Append(base::BinaryValue::CreateWithCopiedBuffer("challenge", 9)); | 414 args->Append(base::BinaryValue::CreateWithCopiedBuffer("challenge", 9)); |
415 args->Append(new base::FundamentalValue(register_key)); | 415 args->AppendBoolean(register_key); |
416 return args; | 416 return args; |
417 } | 417 } |
418 | 418 |
419 EPKPChallengeUserKey impl_; | 419 EPKPChallengeUserKey impl_; |
420 scoped_refptr<EnterprisePlatformKeysChallengeUserKeyFunction> func_; | 420 scoped_refptr<EnterprisePlatformKeysChallengeUserKeyFunction> func_; |
421 }; | 421 }; |
422 | 422 |
423 TEST_F(EPKChallengeUserKeyTest, UserPolicyDisabled) { | 423 TEST_F(EPKChallengeUserKeyTest, UserPolicyDisabled) { |
424 prefs_->SetBoolean(prefs::kAttestationEnabled, false); | 424 prefs_->SetBoolean(prefs::kAttestationEnabled, false); |
425 | 425 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 AccountId::FromUserEmailGaiaId("test@chromium.com", "12345"); | 596 AccountId::FromUserEmailGaiaId("test@chromium.com", "12345"); |
597 }; | 597 }; |
598 | 598 |
599 TEST_F(EPKChallengeUserKeyUnmanagedUserTest, UserNotManaged) { | 599 TEST_F(EPKChallengeUserKeyUnmanagedUserTest, UserNotManaged) { |
600 EXPECT_EQ(EPKPChallengeKeyBase::kUserNotManaged, | 600 EXPECT_EQ(EPKPChallengeKeyBase::kUserNotManaged, |
601 RunFunctionAndReturnError(func_.get(), CreateArgs(), browser())); | 601 RunFunctionAndReturnError(func_.get(), CreateArgs(), browser())); |
602 } | 602 } |
603 | 603 |
604 } // namespace | 604 } // namespace |
605 } // namespace extensions | 605 } // namespace extensions |
OLD | NEW |