Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/mls/tests/mochitest.toml
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Messaging Layer Security</title>
<!-- SimpleTest Helpers -->
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<!-- Local Helpers -->
<script src="head_mls.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
async function test_group_create() {
const mls = new MLS();
// Alice: Create signature keypair and credential
const alice = await mls.generateIdentity();
const credential_alice = await mls.generateCredential("alice");
// Alice: Create a group
const group_alice = await mls.groupCreate(alice, credential_alice);
// Test: compare the generated group identifier to incorrect values
// Note: there is no deterministic test for this value as it is generated randomly
isnot(byteArrayToHexString(group_alice.groupId), "", "Group Identifier != ''");
// Test: the generated group epoch is of size 32
is(group_alice.groupId.length, 32, "Group Epoch should be of size 32");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
test_group_create();
</script>
</pre>
</body>
</html>