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

Side by Side Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698