Skip to content

Commit

Permalink
Add RegionCaptureExperimentalSubtypes to fieldtrial_testing_config.json
Browse files Browse the repository at this point in the history
Bug: None
Change-Id: I7946edb917d81118b3421014a09ea8c0a45dcb98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934359
Reviewed-by: Jordan Bayles <[email protected]>
Commit-Queue: Elad Alon <[email protected]>
Auto-Submit: Elad Alon <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1055214}
  • Loading branch information
Elad Alon authored and chromium-wpt-export-bot committed Oct 5, 2022
1 parent ec95df8 commit 4d7b28d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions mediacapture-region/CropTarget-fromElement.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="instructions">Description</h1>

<div id='test-div'></div>
<iframe id='test-iframe' src="about:blank"></iframe>
<a id='test-a'></a>
<img id='test-img' alt='Alt text' width="500" height="600">
<div id='log'></div>

<script src=/resources/testharness.js></script>
Expand All @@ -37,6 +37,15 @@ <h1 class="instructions">Description</h1>
assert_equals(crop_target.constructor.name, 'CropTarget');
}, "Produces a CropTarget for Elements of subtype div.");

// TODO(crbug.com/1247761): Re-enable after rolling out the
// experiment to allow any Element.
// promise_test(function (t) {
// assert_true(!!CropTarget.fromElement);
//
// return promise_rejects_dom(t, "NotSupportedError",
// CropTarget.fromElement(document.getElementById("test-img")));
// }, "Produces a CropTarget for Elements of subtype img.");

promise_test(t => {
assert_true(!!CropTarget.fromElement);
return promise_rejects_js(t, TypeError,
Expand All @@ -48,13 +57,6 @@ <h1 class="instructions">Description</h1>
return promise_rejects_js(t, TypeError, CropTarget.fromElement(123));
}, "Rejects a non-Element with a TypeError.");

promise_test(function (t) {
assert_true(!!CropTarget.fromElement);

return promise_rejects_dom(t, "NotSupportedError",
CropTarget.fromElement(document.getElementById("test-a")));
}, "Rejects unimplemented Element subtypes with a NotSupportedError");

promise_test(async () => {
assert_true(!!CropTarget.fromElement);

Expand Down

0 comments on commit 4d7b28d

Please sign in to comment.