forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssl_config_unittest.cc
34 lines (25 loc) · 1.01 KB
/
ssl_config_unittest.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/ssl/ssl_config.h"
#include "net/cert/cert_verifier.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
void CheckCertVerifyFlags(SSLConfig* ssl_config,
bool disable_cert_verification_network_fetches) {
ssl_config->disable_cert_verification_network_fetches =
disable_cert_verification_network_fetches;
int flags = ssl_config->GetCertVerifyFlags();
EXPECT_EQ(disable_cert_verification_network_fetches,
!!(flags & CertVerifier::VERIFY_DISABLE_NETWORK_FETCHES));
}
} // namespace
TEST(SSLConfigTest, GetCertVerifyFlags) {
SSLConfig ssl_config;
CheckCertVerifyFlags(&ssl_config,
/*disable_cert_verification_network_fetches*/ false);
CheckCertVerifyFlags(&ssl_config,
/*disable_cert_verification_network_fetches*/ true);
}
} // namespace net