Commit 4aa2044c authored by Jinho Bang's avatar Jinho Bang Committed by Commit Bot

PaymentHandler: Should use NotAllowedError instead of InvalidAccessError

When openWindow() is not triggered by user activation, currently throws
InvalidAccessError. But it's already deprecated in spec level. Instead
we should throw NotAllowedError.

Related spec change:
  https://github.com/w3c/payment-handler/pull/291

Bug: 833532
Change-Id: Icc21301abcafa0ecd00d6232d73a273ca6e4dd9b
Reviewed-on: https://chromium-review.googlesource.com/1013659
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553685}
parent 43f4559e
...@@ -96,8 +96,9 @@ ScriptPromise PaymentRequestEvent::openWindow(ScriptState* script_state, ...@@ -96,8 +96,9 @@ ScriptPromise PaymentRequestEvent::openWindow(ScriptState* script_state,
} }
if (!context->IsWindowInteractionAllowed()) { if (!context->IsWindowInteractionAllowed()) {
resolver->Reject(DOMException::Create(kInvalidAccessError, resolver->Reject(DOMException::Create(
"Not allowed to open a window.")); kNotAllowedError,
"Not allowed to open a window without user activation"));
return promise; return promise;
} }
context->ConsumeWindowInteraction(); context->ConsumeWindowInteraction();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment