Skip to content

Commit c4588f6

Browse files
eehakkinchromium-wpt-export-bot
authored andcommitted
ImageCapture should only be exposed to secure context
This CL modifies ImageCapture by adding SecureContext property. Spec: https://w3c.github.io/mediacapture-image/#imagecaptureapi Spec PR: w3c/mediacapture-image#312 Change-Id: Id05b972b7fa3d004376492993954d881235c2c43 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6461967 Commit-Queue: Eero Hakkinen <[email protected]> Reviewed-by: Rijubrata Bhaumik <[email protected]> Cr-Commit-Position: refs/heads/main@{#1450476}
1 parent 6b1b621 commit c4588f6

9 files changed

+7
-9
lines changed

mediacapture-image/takePhoto-reject.html renamed to mediacapture-image/takePhoto-reject.https.html

+7-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// This test verifies that ImageCapture.takePhoto() rejects if any passed
1616
// option is unsupported or outside its allowed range.
17-
function makePromiseTest(getOption) {
17+
function makePromiseTest(getOption, name) {
1818
image_capture_test(async (t, imageCaptureTest) => {
1919
imageCaptureTest.mockImageCapture().state().redEyeReduction = 0;
2020

@@ -29,7 +29,7 @@
2929
} catch (error) {
3030
assert_equals(error.name, 'NotSupportedError');
3131
}
32-
});
32+
}, name);
3333
}
3434

3535
const optionsGenerators = [
@@ -41,11 +41,9 @@
4141
capabilities => ({ fillLightMode: 'off' }),
4242
];
4343

44-
for (key in optionsGenerators) {
45-
generate_tests(
46-
makePromiseTest,
47-
[[ 'ImageCapture.takePhoto(options) rejects with bad options, #' + key,
48-
optionsGenerators[key] ]]);
49-
}
50-
44+
optionsGenerators.forEach((optionsGenerator, key) => {
45+
makePromiseTest(
46+
optionsGenerator,
47+
`ImageCapture.takePhoto(options) rejects with bad options, #${key}`);
48+
});
5149
</script>

0 commit comments

Comments
 (0)