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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/test/test_blink_web_unit_test_support.h" 5 #include "content/test/test_blink_web_unit_test_support.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 uint64_t expires_ms, 323 uint64_t expires_ms,
324 std::unique_ptr<blink::WebRTCCertificateCallback> callback) override { 324 std::unique_ptr<blink::WebRTCCertificateCallback> callback) override {
325 NOTIMPLEMENTED(); 325 NOTIMPLEMENTED();
326 } 326 }
327 bool isSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override { 327 bool isSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override {
328 return false; 328 return false;
329 } 329 }
330 std::unique_ptr<blink::WebRTCCertificate> fromPEM( 330 std::unique_ptr<blink::WebRTCCertificate> fromPEM(
331 blink::WebString pem_private_key, 331 blink::WebString pem_private_key,
332 blink::WebString pem_certificate) override { 332 blink::WebString pem_certificate) override {
333 return base::MakeUnique<RTCCertificate>( 333 rtc::scoped_refptr<rtc::RTCCertificate> certificate =
334 rtc::RTCCertificate::FromPEM(rtc::RTCCertificatePEM( 334 rtc::RTCCertificate::FromPEM(rtc::RTCCertificatePEM(
335 pem_private_key.utf8(), pem_certificate.utf8()))); 335 pem_private_key.utf8(), pem_certificate.utf8()));
336 if (!certificate)
337 return nullptr;
338 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
336 } 339 }
337 }; 340 };
338 341
339 } // namespace 342 } // namespace
340 #endif // defined(ENABLE_WEBRTC) 343 #endif // defined(ENABLE_WEBRTC)
341 344
342 blink::WebRTCCertificateGenerator* 345 blink::WebRTCCertificateGenerator*
343 TestBlinkWebUnitTestSupport::createRTCCertificateGenerator() { 346 TestBlinkWebUnitTestSupport::createRTCCertificateGenerator() {
344 #if defined(ENABLE_WEBRTC) 347 #if defined(ENABLE_WEBRTC)
345 return new TestWebRTCCertificateGenerator(); 348 return new TestWebRTCCertificateGenerator();
346 #else 349 #else
347 return nullptr; 350 return nullptr;
348 #endif 351 #endif
349 } 352 }
350 353
351 } // namespace content 354 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698