Index: net/ssl/ssl_connection_status_flags_unittest.cc |
diff --git a/net/ssl/ssl_connection_status_flags_unittest.cc b/net/ssl/ssl_connection_status_flags_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3f79b922cee2f64d115171b5f1d2ed1509065e63 |
--- /dev/null |
+++ b/net/ssl/ssl_connection_status_flags_unittest.cc |
@@ -0,0 +1,37 @@ |
+// Copyright (c) 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(12345, SSLConnectionStatusToCipherSuite(connection_status)); |
+ EXPECT_EQ(expected_version, SSLConnectionStatusToVersion(connection_status)); |
+} |
+ |
+TEST(SSLConnectionStatusTest, SetVersion) { |
+ int connection_status = 0xDEADBEEF; |
+ int 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 |