Skip to content

Commit

Permalink
PaymentRequest: fixes allowpaymentrequest test errors (#6418)
Browse files Browse the repository at this point in the history
* Fixes test errors causing test files to fail in Edge and Chrome.
1) The error in removing-allowpaymentrequest.https.sub.html is that the test expects the PaymentRequest Constructor to fail before allowpaymentrequest has been turned off.
2) The error in setting-allowpaymentrequest.https.sub.html is that the test expects the PaymentRequest Constructor to succeed before allowpaymentrequest has ever been turned on.

* Fixes error in setting-allowpaymentrequest-timing.https.sub.html
This test currently fails in Chrome and Edge. From the comments in the test it appears that the test expects to turn on the allowpaymentrequest asynchronously before the iframe can receive the postmessage.
However, the error in the test is that it expects a security error to be thrown after the allowpaymentrequest attribute has been turned on.
  • Loading branch information
AmazingJaze authored and Marcos Cáceres committed Jul 7, 2017
1 parent c080c71 commit 9a6a1f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const path = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1);
iframe.src = "https://{{domains[www1]}}:{{ports[https][0]}}" + path + "echo-PaymentRequest.html";
iframe.onload = t.step_func(() => {
if (i === 0) {
if (i === 1) {
iframe.allowPaymentRequest = false;
}
iframe.contentWindow.postMessage('What is the result of new PaymentRequest(...)?', '*');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
});

window.onmessage = t.step_func_done((e) => {
assert_equals(e.data.message, 'Exception');
assert_array_equals(e.data.details, [true /* ex instanceof DOMException*/, 18 /* ex.code */, 'SecurityError' /* ex.name */]);
assert_equals(e.data.message, 'Success');
});

document.body.appendChild(iframe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const path = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1);
iframe.src = "https://{{domains[www1]}}:{{ports[https][0]}}" + path + "echo-PaymentRequest.html";
iframe.onload = t.step_func(() => {
if (i === 0) {
if (i === 1) {
iframe.allowPaymentRequest = true;
}
iframe.contentWindow.postMessage('What is the result of new PaymentRequest(...)?', '*');
Expand Down

0 comments on commit 9a6a1f4

Please sign in to comment.