1
0
Fork 0
firefox/dom/mls/tests/test_group_create.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

44 lines
1.2 KiB
HTML

<!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>