[Gecko Bug 1939866] Fix some assertions for trusted type sink tests. #49909
+14
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These assertions were added in
#46089
They intend to check the value of the passed sink name to the callbacks
of the default policy, based on the passed trusted type name. However,
the corresponding
switch
statements are no-op because they actuallyexpect trusted type (objects) rather than trusted type names (strings).
For
default-policy-callback-arguments.html
we just remove theswitch
statement, since the sink name is already tested just above.We fix the
switch
for the other files, renaming the argument totrustedTypeName
to make more explicit it is a string and adding adefault branch to catch any unknown type name.
Differential Revision: https://phabricator.services.mozilla.com/D233175
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1939866
gecko-commit: 41077ac9b8c4ace9e7acf885d957a4b8e3bf465c
gecko-reviewers: zsun