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

Side by Side Diff: net/cert/cert_policy_enforcer_unittest.cc

Issue 1408503002: net: Replace COMPILE_ASSERT with static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | net/quic/crypto/crypto_server_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cert/cert_policy_enforcer.h" 5 #include "net/cert/cert_policy_enforcer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 ~DummyEVCertsWhitelist() override {} 42 ~DummyEVCertsWhitelist() override {}
43 43
44 private: 44 private:
45 bool canned_is_valid_; 45 bool canned_is_valid_;
46 bool canned_contains_response_; 46 bool canned_contains_response_;
47 }; 47 };
48 48
49 const char kGoogleAviatorLogID[] = 49 const char kGoogleAviatorLogID[] =
50 "\x68\xf6\x98\xf8\x1f\x64\x82\xbe\x3a\x8c\xee\xb9\x28\x1d\x4c\xfc\x71\x51" 50 "\x68\xf6\x98\xf8\x1f\x64\x82\xbe\x3a\x8c\xee\xb9\x28\x1d\x4c\xfc\x71\x51"
51 "\x5d\x67\x93\xd4\x44\xd1\x0a\x67\xac\xbb\x4f\x4f\xfb\xc4"; 51 "\x5d\x67\x93\xd4\x44\xd1\x0a\x67\xac\xbb\x4f\x4f\xfb\xc4";
52 COMPILE_ASSERT(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length, 52 static_assert(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length,
53 "Incorrect log ID length."); 53 "Incorrect log ID length.");
54 54
55 class CertPolicyEnforcerTest : public ::testing::Test { 55 class CertPolicyEnforcerTest : public ::testing::Test {
56 public: 56 public:
57 void SetUp() override { 57 void SetUp() override {
58 policy_enforcer_.reset(new CertPolicyEnforcer); 58 policy_enforcer_.reset(new CertPolicyEnforcer);
59 59
60 std::string der_test_cert(ct::GetDerEncodedX509Cert()); 60 std::string der_test_cert(ct::GetDerEncodedX509Cert());
61 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(), 61 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(),
62 der_test_cert.size()); 62 der_test_cert.size());
63 ASSERT_TRUE(chain_.get()); 63 ASSERT_TRUE(chain_.get());
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 ct::CTVerifyResult result; 293 ct::CTVerifyResult result;
294 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1, 294 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1,
295 &result); 295 &result);
296 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy( 296 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy(
297 chain_.get(), nullptr, result, BoundNetLog())); 297 chain_.get(), nullptr, result, BoundNetLog()));
298 } 298 }
299 299
300 } // namespace 300 } // namespace
301 301
302 } // namespace net 302 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/crypto/crypto_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698