~mmach/netext73/webkit2gtk

« back to all changes in this revision

Viewing changes to Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-cancel.html

  • Committer: mmach
  • Date: 2023-06-16 17:21:37 UTC
  • Revision ID: netbit73@gmail.com-20230616172137-2rqx6yr96ga9g3kp
1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<input type="text" id="input">
 
2
<script>
 
3
    if (window.internals) {
 
4
        internals.setMockWebAuthenticationConfiguration({ silentFailure: true, hid: { expectCancel: true } });
 
5
        internals.withUserGesture(() => { input.focus(); });
 
6
    }
 
7
 
 
8
    const options = {
 
9
        publicKey: {
 
10
            challenge: new Uint8Array(16),
 
11
            timeout: 100
 
12
        }
 
13
    };
 
14
 
 
15
    navigator.credentials.get(options).then(credential => {
 
16
        // console.log("Succeeded!");
 
17
        window.webkit.messageHandlers.testHandler.postMessage("Succeeded!");
 
18
    }, error => {
 
19
        // console.log(error.message);
 
20
        window.webkit.messageHandlers.testHandler.postMessage(error.message);
 
21
    });
 
22
</script>