Unreviewed, rolling out r228444.
[WebKit-https.git] / LayoutTests / http / wpt / credential-management / credentialscontainer-store-basics.https.html
1 <!DOCTYPE html>
2 <title>Credential Management API: store() basics.</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script>
6     function asciiToUint8Array(str)
7     {
8         var chars = [];
9         for (var i = 0; i < str.length; ++i)
10             chars.push(str.charCodeAt(i));
11         return new Uint8Array(chars);
12     }
13
14     promise_test(async function(t) {
15         const options = {
16             publicKey: {
17                 rp: {
18                     name: "localhost",
19                 },
20                 user: {
21                     name: "John Appleseed",
22                     id: asciiToUint8Array("123456"),
23                     displayName: "Appleseed",
24                 },
25                 challenge: asciiToUint8Array("123456"),
26                 pubKeyCredParams: [{ type: "public-key", alg: -7 }],
27             }
28         };
29
30         const credential = await navigator.credentials.create(options);
31         return promise_rejects(t, "NotSupportedError",
32             navigator.credentials.store(credential));
33     }, "navigator.credentials.store().");
34 </script>