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

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

Issue 317613004: Remove usage of singleton software_slot_ in nss on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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
« no previous file with comments | « crypto/rsa_private_key_nss_unittest.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) 2011 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 "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 12 matching lines...) Expand all
23 23
24 namespace net { 24 namespace net {
25 25
26 namespace { 26 namespace {
27 27
28 class KeygenHandlerTest : public ::testing::Test { 28 class KeygenHandlerTest : public ::testing::Test {
29 public: 29 public:
30 KeygenHandlerTest() {} 30 KeygenHandlerTest() {}
31 virtual ~KeygenHandlerTest() {} 31 virtual ~KeygenHandlerTest() {}
32 32
33 virtual void SetUp() { 33 private:
34 #if defined(OS_CHROMEOS) && defined(USE_NSS) 34 #if defined(OS_CHROMEOS) && defined(USE_NSS)
35 crypto::OpenPersistentNSSDB(); 35 crypto::ScopedTestNSSDB test_nss_db_;
36 #endif 36 #endif
37 }
38 }; 37 };
39 38
40 // Assert that |result| is a valid output for KeygenHandler given challenge 39 // Assert that |result| is a valid output for KeygenHandler given challenge
41 // string of |challenge|. 40 // string of |challenge|.
42 void AssertValidSignedPublicKeyAndChallenge(const std::string& result, 41 void AssertValidSignedPublicKeyAndChallenge(const std::string& result,
43 const std::string& challenge) { 42 const std::string& challenge) {
44 ASSERT_GT(result.length(), 0U); 43 ASSERT_GT(result.length(), 0U);
45 44
46 // Verify it's valid base64: 45 // Verify it's valid base64:
47 std::string spkac; 46 std::string spkac;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 events[i] = NULL; 124 events[i] = NULL;
126 125
127 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i]; 126 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i];
128 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge"); 127 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge");
129 } 128 }
130 } 129 }
131 130
132 } // namespace 131 } // namespace
133 132
134 } // namespace net 133 } // namespace net
OLDNEW
« no previous file with comments | « crypto/rsa_private_key_nss_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698