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

Side by Side Diff: net/base/keygen_handler_unittest.cc

Issue 6667020: This change loads opencryptoki and uses the TPM for keygen tags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding missing args in unit tests Created 9 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 unified diff | Download patch | Annotate | Revision Log
« base/nss_util.cc ('K') | « net/base/keygen_handler_nss.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/base/keygen_handler.h" 5 #include "net/base/keygen_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
(...skipping 12 matching lines...) Expand all
24 24
25 namespace { 25 namespace {
26 26
27 class KeygenHandlerTest : public ::testing::Test { 27 class KeygenHandlerTest : public ::testing::Test {
28 public: 28 public:
29 KeygenHandlerTest() {} 29 KeygenHandlerTest() {}
30 virtual ~KeygenHandlerTest() {} 30 virtual ~KeygenHandlerTest() {}
31 31
32 virtual void SetUp() { 32 virtual void SetUp() {
33 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
34 base::OpenPersistentNSSDB(); 34 base::OpenPersistentNSSDB(true);
35 #endif 35 #endif
36 } 36 }
37 }; 37 };
38 38
39 // Assert that |result| is a valid output for KeygenHandler given challenge 39 // Assert that |result| is a valid output for KeygenHandler given challenge
40 // string of |challenge|. 40 // string of |challenge|.
41 void AssertValidSignedPublicKeyAndChallenge(const std::string& result, 41 void AssertValidSignedPublicKeyAndChallenge(const std::string& result,
42 const std::string& challenge) { 42 const std::string& challenge) {
43 ASSERT_GT(result.length(), 0U); 43 ASSERT_GT(result.length(), 0U);
44 44
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 events[i] = NULL; 138 events[i] = NULL;
139 139
140 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i]; 140 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i];
141 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge"); 141 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge");
142 } 142 }
143 } 143 }
144 144
145 } // namespace 145 } // namespace
146 146
147 } // namespace net 147 } // namespace net
OLDNEW
« base/nss_util.cc ('K') | « net/base/keygen_handler_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698