Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RTCCertificate IDL test #5692

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions webrtc/RTCCertificate-idl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>IDL check of RTCCertificate</title>
<link rel="author" title="Soares Chen" href="mailto:soares.chen@gmail.com"/>
<link rel="help" href="http://w3c.github.io/webrtc-pc/#dom-rtccertificate">
</head>
<body>

<h1 class="instructions">Description</h1>
<p class="instructions">This test verifies the availability of the RTCCertificate interface.</p>
<div id='log'></div>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>

<!-- This IDL is copied from the 13 March 2017 editors' draft. -->
<script type="text/plain">
interface RTCCertificate {
readonly attribute DOMTimeStamp expires;
readonly attribute FrozenArray<RTCDtlsFingerprint> fingerprints;
AlgorithmIdentifier getAlgorithm();
};
</script>

<script>
(() => {
const idl_array = new IdlArray();

for(const node of document.querySelectorAll("script[type=text\\/plain]")) {
idl_array.add_idls(node.textContent);
}

promise_test(() => {
// The given parameter must be supported by generateCertifiate()
return RTCPeerConnection.generateCertificate({
name: "RSASSA-PKCS1-v1_5",
modulusLength: 2048,
publicExponent: new Uint8Array([1, 0, 1]),
hash: "SHA-256"
})
.then(cert => {
window.rtcCert = cert;
idl_array.add_objects({"RTCCertificate": ["rtcCert"]});
idl_array.test();
});
}, "RTCCertificate IDL Test");
})();
</script>
</body>
</html>