|
30 | 30 | img.src = IMAGE_URL;
|
31 | 31 | await imgWatcher.wait_for("load");
|
32 | 32 | const detector = crossOriginTest.createDetector();
|
33 |
| - await promise_rejects(t, "SecurityError", detector.detect(img)); |
34 |
| - }, `${crossOriginTest.detectorType} should reject cross-origin \ |
35 |
| -HTMLImageElements with a SecurityError.`); |
| 33 | + promise_rejects(t, "SecurityError", detector.detect(img)); |
| 34 | + }, crossOriginTest.detectorType |
| 35 | + + " should reject cross-origin HTMLImageElements with a SecurityError."); |
36 | 36 |
|
37 | 37 | // Verifies that Detector rejects a cross-origin ImageBitmap.
|
38 | 38 | promise_test(async t => {
|
|
42 | 42 | await imgWatcher.wait_for("load");
|
43 | 43 | const imgBitmap = await createImageBitmap(img);
|
44 | 44 | const detector = crossOriginTest.createDetector();
|
45 |
| - await promise_rejects(t, "SecurityError", detector.detect(imgBitmap)); |
46 |
| - }, `${crossOriginTest.detectorType} should reject cross-origin \ |
47 |
| -ImageBitmaps with a SecurityError.`); |
| 45 | + promise_rejects(t, "SecurityError", detector.detect(imgBitmap)); |
| 46 | + }, crossOriginTest.detectorType |
| 47 | + + " should reject cross-origin ImageBitmaps with a SecurityError."); |
48 | 48 |
|
49 | 49 | // Verifies that Detector rejects a cross-origin HTMLVideoElement.
|
50 | 50 | promise_test(async t => {
|
|
53 | 53 | video.src = VIDEO_URL;
|
54 | 54 | await videoWatcher.wait_for("loadeddata");
|
55 | 55 | const detector = crossOriginTest.createDetector();
|
56 |
| - await promise_rejects(t, "SecurityError", detector.detect(video)); |
57 |
| - }, `${crossOriginTest.detectorType} should reject cross-origin \ |
58 |
| -HTMLVideoElements with a SecurityError.`); |
59 |
| - |
60 |
| - // Verifies that Detector rejects a cross-origin HTMLCanvasElement. |
61 |
| - promise_test(async t => { |
62 |
| - const img = new Image(); |
63 |
| - const imgWatcher = new EventWatcher(t, img, ["load", "error"]); |
64 |
| - img.src = IMAGE_URL; |
65 |
| - await imgWatcher.wait_for("load"); |
66 |
| - const canvas = document.createElement("canvas"); |
67 |
| - canvas.getContext("2d").drawImage(img, 0, 0); |
68 |
| - const detector = crossOriginTest.createDetector(); |
69 |
| - await promise_rejects(t, "SecurityError", detector.detect(canvas)); |
70 |
| - }, `${crossOriginTest.detectorType} should reject cross-origin \ |
71 |
| -HTMLCanvasElement with a SecurityError.`); |
| 56 | + promise_rejects(t, "SecurityError", detector.detect(video)); |
| 57 | + }, crossOriginTest.detectorType |
| 58 | + + " should reject cross-origin HTMLVideoElements with a SecurityError."); |
72 | 59 |
|
73 | 60 | }
|
74 | 61 |
|
|
0 commit comments