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

Unified Diff: chrome/test/data/webrtc/peerconnection.js

Issue 1909923002: Making RTCCertificate cloneable (WIP). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Derp! Created 4 years, 7 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 | « chrome/test/data/webrtc/indexeddb.js ('k') | chrome/test/data/webrtc/webrtc_audio_quality_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/peerconnection.js
diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js
index 50459b7c62caec20e0d48d36ddd066f00d351837..dc33943d7eadccf36ba19e5bdbea77d861a568cb 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -35,21 +35,15 @@ var gHasSeenCryptoInSdp = 'no-crypto-seen';
*/
function preparePeerConnection(keygenAlgorithm = null) {
if (gPeerConnection !== null)
- throw failTest('creating peer connection, but we already have one.');
+ throw failTest('Creating peer connection, but we already have one.');
if (keygenAlgorithm === null) {
gPeerConnection = createPeerConnection_(null);
returnToTest('ok-peerconnection-created');
} else {
- webkitRTCPeerConnection.generateCertificate(keygenAlgorithm).then(
+ RTCPeerConnection.generateCertificate(keygenAlgorithm).then(
function(certificate) {
- if (gPeerConnection !== null) {
- throw failTest('peer connection already set during certificate ' +
- + 'generation.');
- }
- gPeerConnection = createPeerConnection_(
- {iceServers:[], certificates:[certificate]});
- returnToTest('ok-peerconnection-created');
+ preparePeerConnectionWithCertificate(certificate);
},
function() {
failTest('Certificate generation failed. keygenAlgorithm: ' +
@@ -58,6 +52,14 @@ function preparePeerConnection(keygenAlgorithm = null) {
}
}
+function preparePeerConnectionWithCertificate(certificate) {
+ if (gPeerConnection !== null)
+ throw failTest('Creating peer connection, but we already have one.');
+ gPeerConnection = createPeerConnection_(
+ {iceServers:[], certificates:[certificate]});
+ returnToTest('ok-peerconnection-created');
+}
+
/**
* Asks this page to create a local offer.
*
« no previous file with comments | « chrome/test/data/webrtc/indexeddb.js ('k') | chrome/test/data/webrtc/webrtc_audio_quality_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698