Skip to content

Commit

Permalink
Bug 1673596 [wpt PR 26304] - [WebOTP] Prototyping WebOTP support in c…
Browse files Browse the repository at this point in the history
…ross-origin iframes, a=testonly

Automatic update from web-platform-tests
[WebOTP] Prototyping WebOTP support in cross-origin iframes

Major changes:
1. Adds a new policy-controlled feature "otp-credentials" to allow the
  iframe to get credentials from its parent frame.
2. Supports parsing SMSes with format "@top.com #code @iframe.com"
3. Passes along a list of origins in the system instead of a single
  origin previously.

More details on the context: WICG/web-otp#50

Bug: 1136506
Change-Id: Ic458e51c33b721a80204abb490776b436086bff4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497992
Commit-Queue: Yi Gu <yigu@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831865}

--

wpt-commits: f7b85ab73e04994eea940c2a7a81f98c8bc75c14
wpt-pr: 26304
  • Loading branch information
yi-gu authored and moz-wptsync-bot committed Dec 3, 2020
1 parent 33e2884 commit 2bc0068
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@

}, "Test OTPCredential enabled in same origin iframes");

promise_test(async t => {
const messageWatcher = new EventWatcher(t, window, "message");
var iframe = document.createElement("iframe");
iframe.src = remoteBaseURL + "support/otpcredential-iframe.html"
iframe.allow = "otp-credentials";
document.body.appendChild(iframe);

const message = await messageWatcher.wait_for("message");
assert_equals(message.data.result, "Pass");
assert_equals(message.data.code, "ABC123");

}, "OTPCredential enabled in cross origin iframes with permissions policy");

promise_test(async t => {
const messageWatcher = new EventWatcher(t, window, "message");
var iframe = document.createElement("iframe");
Expand All @@ -37,5 +50,5 @@
assert_equals(message.data.result, "Fail");
assert_equals(message.data.errorType, "NotAllowedError");

}, "Test OTPCredential disabled in cross origin iframes");
}, "OTPCredential disabled in cross origin iframes without permissions policy");
</script>

0 comments on commit 2bc0068

Please sign in to comment.