blob: 9827605557edf4d40bb9b26a4d8918da11d9a327 (
plain)
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
35
36
37
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/ssl/ssl_connection_status_flags.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
TEST(SSLConnectionStatusTest, SetCipherSuite) {
int connection_status = 0xDEADBEEF;
int expected_version = SSLConnectionStatusToVersion(connection_status);
SSLConnectionStatusSetCipherSuite(12345, &connection_status);
EXPECT_EQ(12345U, SSLConnectionStatusToCipherSuite(connection_status));
EXPECT_EQ(expected_version, SSLConnectionStatusToVersion(connection_status));
}
TEST(SSLConnectionStatusTest, SetVersion) {
int connection_status = 0xDEADBEEF;
uint16_t expected_cipher_suite =
SSLConnectionStatusToCipherSuite(connection_status);
SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_TLS1_2,
&connection_status);
EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_2,
SSLConnectionStatusToVersion(connection_status));
EXPECT_EQ(expected_cipher_suite,
SSLConnectionStatusToCipherSuite(connection_status));
}
} // namespace
} // namespace net
|