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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/iframed-credentialscontainer.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/iframed-credentialscontainer.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/iframed-credentialscontainer.html
new file mode 100644
index 0000000000000000000000000000000000000000..289c5d2ed5ce34fd282c58169f14a570f3b66ed2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/iframed-credentialscontainer.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.addMockCredentialManagerResponse("id", "name", "", "password");
+
+navigator.credentials.get({ 'password': true })
+ .then(c => {
+ window.top.postMessage({
+ "credential": c,
+ "exception": null
+ }, "*");
+ })
+ .catch(omg => {
+ window.top.postMessage({
+ "credential": null,
+ "exception": omg.name
+ }, "*");
+ });
+
+navigator.credentials.store(new PasswordCredential({'id': 'name', 'password': 'password' }))
+ .then(c => {
+ window.top.postMessage({
+ "credential": c,
+ "exception": null
+ }, "*");
+ })
+ .catch(omg => {
+ window.top.postMessage({
+ "credential": null,
+ "exception": omg.name
+ }, "*");
+ });
+
+navigator.credentials.requireUserMediation()
+ .then(c => {
+ window.top.postMessage({
+ "credential": c,
+ "exception": null
+ }, "*");
+ })
+ .catch(omg => {
+ window.top.postMessage({
+ "credential": null,
+ "exception": omg.name
+ }, "*");
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698