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

Unified Diff: content/test/test_blink_web_unit_test_support.cc

Issue 2432493002: Handle RTCCertificate::fromPEM returning nullptr, with a unit test. (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
Index: content/test/test_blink_web_unit_test_support.cc
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index b8f549db21f7bb1b7ea3635c4f4af5ac58bf8891..6ffcac0dd5e71ba8edd574363438822e98d27935 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -330,9 +330,12 @@ class TestWebRTCCertificateGenerator
std::unique_ptr<blink::WebRTCCertificate> fromPEM(
blink::WebString pem_private_key,
blink::WebString pem_certificate) override {
- return base::MakeUnique<RTCCertificate>(
+ rtc::scoped_refptr<rtc::RTCCertificate> certificate =
rtc::RTCCertificate::FromPEM(rtc::RTCCertificatePEM(
- pem_private_key.utf8(), pem_certificate.utf8())));
+ pem_private_key.utf8(), pem_certificate.utf8()));
+ if (!certificate)
+ return nullptr;
+ return base::MakeUnique<RTCCertificate>(certificate);
sky 2016/10/21 23:13:11 Is RTCCertificate and rtc::RTCCertificate differen
jbroman 2016/10/22 15:33:26 Yes, the former is content::RTCCertificate (in con
}
};

Powered by Google App Engine
This is Rietveld 408576698