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

Side by Side Diff: webrtc/base/rtccertificate_unittests.cc

Issue 1753293002: Safe numeric library: base/numerics (copied from Chromium) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master + correct new safe_conversions.h include Created 4 years, 9 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 | « webrtc/base/opensslstreamadapter.cc ('k') | webrtc/base/safe_conversions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
17 #include "webrtc/base/rtccertificate.h" 18 #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
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
OLDNEW
« no previous file with comments | « webrtc/base/opensslstreamadapter.cc ('k') | webrtc/base/safe_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698