Skip to content

Commit

Permalink
Reject requestPresenter if presentation area does not belong to the d…
Browse files Browse the repository at this point in the history
…ocument.

Throw NotAllowedError Dom exception if presentation area is not
in the document.

Bug: 1258357
Change-Id: Icb2ccadf4a5ca88c726da53200217c7b4a441378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3261544
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Olga Gerchikov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#939431}
  • Loading branch information
ogerchikov authored and chromium-wpt-export-bot committed Nov 8, 2021
1 parent 399ddc8 commit b367e55
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.ink.requestPresenter('invalid-param'));
}, "Receive rejected promise for an invalid param.");

promise_test(t => {
var canvas = document.createElement("canvas");
var fragment = document.createElement("template").content;
fragment.appendChild(canvas);
return promise_rejects_dom(t, 'NotAllowedError',
navigator.ink.requestPresenter({presentationArea: canvas}));
}, "Received rejected promise for presentation area not in the document.");

promise_test(() => {
return navigator.ink.requestPresenter();
}, "Received fulfilled promise for no param");
Expand All @@ -20,4 +28,4 @@ promise_test(() => {

promise_test(() => {
return navigator.ink.requestPresenter({presentationArea: null});
}, "Received fulfilled promise for dictionary param with valid element.");
}, "Received fulfilled promise for dictionary param with valid element.");

0 comments on commit b367e55

Please sign in to comment.