Skip to content

Commit

Permalink
Correctly escape ')' in Permission Policy WPTs.
Browse files Browse the repository at this point in the history
As per documentation [1], `wptserve` pipes require ')' characters to be
escaped, but this was missing in a couple of Permission Policy Web
Platform Tests.

[1]: third_party/blink/web_tests/external/wpt/docs/writing-tests/server-pipes.md

Bug: 1513607
Change-Id: Ic46849809445b95bbf641c123cffe54cfcaf61f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5163893
Reviewed-by: Kamila Hasanbega <[email protected]>
Commit-Queue: Balazs Engedy <[email protected]>
Auto-Submit: Balazs Engedy <[email protected]>
Commit-Queue: Kamila Hasanbega <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1242400}
  • Loading branch information
Balazs Engedy authored and chromium-wpt-export-bot committed Jan 3, 2024
1 parent bc19e8e commit d63bd84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
test(function() {
test_frame_policy(
'fullscreen',
same_origin_src + pipe_front + header_policies[j] + pipe_end,
same_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].sameOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on same origin iframe with allow = "' + policies[i].allow +
'" and header policy = "Permissions-Policy: fullscreen=' + header_policies[j] + ';".');
test(function() {
test_frame_policy(
'fullscreen',
cross_origin_src + pipe_front + header_policies[j] + pipe_end,
cross_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].crossOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on cross origin iframe with allow = "' + policies[i].allow +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,29 @@
}

// Test that the header policy of the iframe document does not change the
// frame policy.
// frame policy.:
for (var i = 0; i < policies.length; i++) {
for (var j = 0; j < header_policies.length; j++) {
test(function() {
test_frame_policy(
'fullscreen',
same_origin_src + pipe_front + header_policies[j] + pipe_end,
same_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].sameOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on same origin iframe with allow = "' + policies[i].allow +
'" and header policy = "Permissions-Policy: fullscreen=' + header_policies[j] + ';".');
test(function() {
test_frame_policy(
'fullscreen',
cross_origin_src + pipe_front + header_policies[j] + pipe_end,
cross_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].crossOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on cross origin iframe with allow = "' + policies[i].allow +
'" and header policy = "Permissions-Policy: fullscreen=' + header_policies[j] + ';".');
test(function() {
test_frame_policy(
'fullscreen',
cross_origin_src1 + pipe_front + header_policies[j] + pipe_end,
cross_origin_src1 + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].crossOrigin1TestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on another cross origin iframe with allow = "' + policies[i].allow +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@
test(function() {
test_frame_policy(
'fullscreen',
same_origin_src + pipe_front + header_policies[j] + pipe_end,
same_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].sameOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on same origin iframe with allow = "' + policies[i].allow +
'" and header policy = "Permissions-Policy: fullscreen=' + header_policies[j] + ';".');
test(function() {
test_frame_policy(
'fullscreen',
cross_origin_src + pipe_front + header_policies[j] + pipe_end,
cross_origin_src + pipe_front + header_policies[j].replace(")", "\\)") + pipe_end,
undefined, policies[i].crossOriginTestExpect,
'fullscreen ' + policies[i].allow + ';');
}, 'Test frame policy on cross origin iframe with allow = "' + policies[i].allow +
Expand Down

0 comments on commit d63bd84

Please sign in to comment.