OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/base/fakesslidentity.h" | 14 #include "webrtc/base/fakesslidentity.h" |
15 #include "webrtc/base/gunit.h" | 15 #include "webrtc/base/gunit.h" |
16 #include "webrtc/base/logging.h" | 16 #include "webrtc/base/logging.h" |
17 #include "webrtc/base/numerics/safe_conversions.h" | |
18 #include "webrtc/base/rtccertificate.h" | 17 #include "webrtc/base/rtccertificate.h" |
| 18 #include "webrtc/base/safe_conversions.h" |
19 #include "webrtc/base/scoped_ptr.h" | 19 #include "webrtc/base/scoped_ptr.h" |
20 #include "webrtc/base/sslidentity.h" | 20 #include "webrtc/base/sslidentity.h" |
21 #include "webrtc/base/thread.h" | 21 #include "webrtc/base/thread.h" |
22 #include "webrtc/base/timeutils.h" | 22 #include "webrtc/base/timeutils.h" |
23 | 23 |
24 namespace rtc { | 24 namespace rtc { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 static const char* kTestCertCommonName = "RTCCertificateTest's certificate"; | 28 static const char* kTestCertCommonName = "RTCCertificateTest's certificate"; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 uint64_t now = NowSeconds(); | 109 uint64_t now = NowSeconds(); |
110 scoped_refptr<RTCCertificate> certificate = | 110 scoped_refptr<RTCCertificate> certificate = |
111 GenerateCertificateWithExpires(now + 1); | 111 GenerateCertificateWithExpires(now + 1); |
112 // Now it should not have expired. | 112 // Now it should not have expired. |
113 EXPECT_FALSE(HasExpiredSeconds(certificate, now)); | 113 EXPECT_FALSE(HasExpiredSeconds(certificate, now)); |
114 // In 2s it should have expired. | 114 // In 2s it should have expired. |
115 EXPECT_TRUE(HasExpiredSeconds(certificate, now + 2)); | 115 EXPECT_TRUE(HasExpiredSeconds(certificate, now + 2)); |
116 } | 116 } |
117 | 117 |
118 } // namespace rtc | 118 } // namespace rtc |
OLD | NEW |