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

Unified Diff: webrtc/base/rtccertificate_unittest.cc

Issue 2424093002: Return nullptr from RTCCertificate::FromPEM on failure. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/rtccertificate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/rtccertificate_unittest.cc
diff --git a/webrtc/base/rtccertificate_unittest.cc b/webrtc/base/rtccertificate_unittest.cc
index f5df7f1130be8c143ccb2915177c4e5107e94aff..b318717790916f79e1afdda37cc63fcc39b591ba 100644
--- a/webrtc/base/rtccertificate_unittest.cc
+++ b/webrtc/base/rtccertificate_unittest.cc
@@ -137,4 +137,10 @@ TEST_F(RTCCertificateTest, CloneWithPEMSerialization) {
EXPECT_EQ(orig->Expires(), clone->Expires());
}
+TEST_F(RTCCertificateTest, FromPEMWithInvalidPEM) {
+ RTCCertificatePEM pem("not a valid PEM", "not a valid PEM");
+ scoped_refptr<RTCCertificate> certificate = RTCCertificate::FromPEM(pem);
+ EXPECT_FALSE(certificate);
+}
+
} // namespace rtc
« no previous file with comments | « webrtc/base/rtccertificate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698