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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html

Issue 1373023002: RTCCertificate, RTCPeerConnection.generateCertificate (WebRTC JavaScript) added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits + Pass webkit_tests (updated global-interface-listing-expected.txt) Created 5 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: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html
index ef61d8c3d14fa36e8fb43ab5b4b332a3e462f374..f256f8576b462c794c23803ff73e3a29fe6285a2 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html
@@ -60,6 +60,47 @@ shouldThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});");
shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});");
shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});");
shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandatory:{valid_and_supported_1:1}});");
+
+// Construct with certificates.
+shouldNotThrow("new webkitRTCPeerConnection({certificates:null}, null);");
+shouldNotThrow("new webkitRTCPeerConnection({certificates:[]}, null);");
+shouldThrow("new webkitRTCPeerConnection({certificates:[null]}, null);");
+shouldThrow("new webkitRTCPeerConnection({certificates:[1337]}, null);");
+// Global certificate variables so that the "should..." methods can evaluate them.
+var certRSA = null;
+var certECDSA = null;
+function testCertificates1RSA()
+{
+ webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", modulusLength: 2048, publicExponent: 65537 })
+ .then(function(certificate) {
+ certRSA = certificate;
+ shouldNotThrow('new webkitRTCPeerConnection({certificates:[certRSA]}, null);');
+ testCertificates2ECDSA();
+ },
+ function() {
+ testFailed('Generating RSA 2048');
+ testCertificates2ECDSA();
+ });
+}
+function testCertificates2ECDSA()
+{
+ webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" })
+ .then(function(certificate) {
+ certECDSA = certificate;
+ shouldNotThrow('new webkitRTCPeerConnection({certificates:[certECDSA]}, null);');
+ finishJSTest();
+ },
+ function() {
+ testFailed('Generating ECDSA P-256');
+ finishJSTest();
+ });
+}
+// Sequentially test construction with RSA and ECDSA certificates.
+// testCertificates2ECDSA's callback methods mark the end of the async tests.
+testCertificates1RSA();
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698