6 <title>Test for Messaging Layer Security
</title>
7 <!-- SimpleTest Helpers -->
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
10 <!-- Local Helpers -->
11 <script src=
"head_mls.js"></script>
15 <script class=
"testbody" type=
"text/javascript">
17 async function test_group_create() {
19 const mls = new MLS();
21 // Alice: Create signature keypair and credential
22 const alice = await mls.generateIdentity();
23 const credential_alice = await mls.generateCredential(
"alice");
25 // Alice: Create a group
26 const group_alice = await mls.groupCreate(alice, credential_alice);
28 // Test: compare the generated group identifier to incorrect values
29 // Note: there is no deterministic test for this value as it is generated randomly
30 isnot(byteArrayToHexString(group_alice.groupId),
"",
"Group Identifier != ''");
32 // Test: the generated group epoch is of size
32
33 is(group_alice.groupId.length,
32,
"Group Epoch should be of size 32");
38 SimpleTest.waitForExplicitFinish();