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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection.html

Issue 1644553002: Constructing an RTCPeerConnection with expired certificates should throw an exception. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase /w master. Updated test to generate expired certificate and verify exception is thrown Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("Tests the RTCPeerConnection constructor."); 8 description("Tests the RTCPeerConnection constructor.");
9 9
10 shouldNotThrow("new webkitRTCPeerConnection(null);"); 10 shouldNotThrow("new webkitRTCPeerConnection(null);");
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato ry:{valid_and_supported_1:1}});"); 59 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato ry:{valid_and_supported_1:1}});");
60 60
61 // Construct with certificates. 61 // Construct with certificates.
62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null}); "); 62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null}); ");
63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]});") ; 63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]});") ;
64 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]});" ); 64 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]});" );
65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]});" ); 65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]});" );
66 // Global certificate variables so that the "should..." methods can evaluate the m. 66 // Global certificate variables so that the "should..." methods can evaluate the m.
67 var certRSA = null; 67 var certRSA = null;
68 var certECDSA = null; 68 var certECDSA = null;
69 var certExpired = null;
69 70
70 function testCertificates1RSA() 71 function testCertificates1RSA()
71 { 72 {
72 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }) 73 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" })
73 .then(function(certificate) { 74 .then(function(certificate) {
74 certRSA = certificate; 75 certRSA = certificate;
75 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce rtificates:[certRSA]}, null);'); 76 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce rtificates:[certRSA]}, null);');
76 testCertificates2ECDSA(); 77 testCertificates2ECDSA();
77 }, 78 },
78 function() { 79 function() {
79 testFailed('Generating RSA 2048'); 80 testFailed('Generating RSA 2048');
80 testCertificates2ECDSA(); 81 testCertificates2ECDSA();
81 }); 82 });
82 } 83 }
83 function testCertificates2ECDSA() 84 function testCertificates2ECDSA()
84 { 85 {
85 webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P- 256" }) 86 webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P- 256" })
86 .then(function(certificate) { 87 .then(function(certificate) {
87 certECDSA = certificate; 88 certECDSA = certificate;
88 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce rtificates:[certECDSA]}, null);'); 89 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce rtificates:[certECDSA]}, null);');
90 testCertificates3Expired();
91 },
92 function() {
93 testFailed('Generating ECDSA P-256');
94 testCertificates3Expired();
95 });
96 }
97 function testCertificates3Expired()
98 {
99 webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P- 256", expires:0 })
100 .then(function(certificate) {
101 certExpired = certificate;
102 shouldBeTrue('certExpired.expires <= new Date().getTime()');
103 shouldThrow('new webkitRTCPeerConnection({iceServers:[], certi ficates:[certExpired]}, null);');
89 finishJSTest(); 104 finishJSTest();
90 }, 105 },
91 function() { 106 function() {
92 testFailed('Generating ECDSA P-256'); 107 testFailed('Generating ECDSA P-256');
93 finishJSTest(); 108 finishJSTest();
94 }); 109 });
95 } 110 }
96 // Sequentially test construction with RSA and ECDSA certificates. 111 // Sequentially test construction with RSA and ECDSA certificates.
97 // testCertificates2ECDSA's callback methods mark the end of the async tests. 112 // testCertificates3Expired's callback methods mark the end of the async tests.
98 testCertificates1RSA(); 113 testCertificates1RSA();
99 114
100 window.jsTestIsAsync = true; 115 window.jsTestIsAsync = true;
101 window.successfullyParsed = true; 116 window.successfullyParsed = true;
102 </script> 117 </script>
103 </body> 118 </body>
104 </html> 119 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698