summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shape-detection/detection-SVGImageElement.https.window.js
blob: 22f1629eccb1954c0385f3833b744b606749c87b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';

promise_test(async (t) => {
  const image = document.createElementNS("http://www.w3.org/2000/svg", "image");
  const detector = new FaceDetector();
  await promise_rejects_dom(t, 'NotSupportedError', detector.detect(image));
}, 'FaceDetector.detect() rejects on an SVGImageElement');

promise_test(async (t) => {
  const image = document.createElementNS("http://www.w3.org/2000/svg", "image");
  const detector = new BarcodeDetector();
  await promise_rejects_dom(t, 'NotSupportedError', detector.detect(image));
}, 'BarcodeDetector.detect() rejects on an SVGImageElement');

promise_test(async (t) => {
  const image = document.createElementNS("http://www.w3.org/2000/svg", "image");
  const detector = new TextDetector();
  await promise_rejects_dom(t, 'NotSupportedError', detector.detect(image));
}, 'TextDetector.detect() rejects on an SVGImageElement');