Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/iframed-credentialscontainer.html

Issue 1861663002: CREDENTIAL: Block API access from non-top-level Documents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: security_check Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script>
3 if (window.testRunner)
4 testRunner.addMockCredentialManagerResponse("id", "name", "", "password");
5
6 navigator.credentials.get({ 'password': true })
7 .then(c => {
8 window.top.postMessage({
9 "credential": c,
10 "exception": null
11 }, "*");
12 })
13 .catch(omg => {
14 window.top.postMessage({
15 "credential": null,
16 "exception": omg.name
17 }, "*");
18 });
19
20 navigator.credentials.store(new PasswordCredential({'id': 'name', 'password': 'p assword' }))
21 .then(c => {
22 window.top.postMessage({
23 "credential": c,
24 "exception": null
25 }, "*");
26 })
27 .catch(omg => {
28 window.top.postMessage({
29 "credential": null,
30 "exception": omg.name
31 }, "*");
32 });
33
34 navigator.credentials.requireUserMediation()
35 .then(c => {
36 window.top.postMessage({
37 "credential": c,
38 "exception": null
39 }, "*");
40 })
41 .catch(omg => {
42 window.top.postMessage({
43 "credential": null,
44 "exception": omg.name
45 }, "*");
46 });
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698