Skip to content

Commit

Permalink
Refactor some sandbox top-navigation tests as browsertests.
Browse files Browse the repository at this point in the history
A series of tentative WPTs were written to test updates to our
framebusting interventions. Some of the tests written test non-standard
behavior, and have been resulting in failures when other browsers (who
have not implemented our framebusting interventions) try to run them.
There are also issues with some of the tests themselves when running in
headless mode, as they require giving user activation to a subframe in a
separate window the test opens, which is something headless mode doesn't
currently support. To fix both of these problems, this CL refactors the
problematic tests into browser tests.

Most of the WPTs are staying as is, since they test standard behavior
and don't have compatibility issues with headless mode.

The following tests are being refactored into browser tests:
* sandbox-top-navigation-cross-origin-escalate
  * now FramebustingFromPrivilegeEscalationFails
* sandbox-top-navigation-child-cross-origin-delivered
  * now FramebustingFromDeliveredFlagsFails
* sandbox-top-navigation-cross-site
  * now FramebustingAfterCrossSiteNavigationFails
* sandbox-top-navigation-grandchild-sandboxed-escalate
  * now FramebustingFromGrandchildPrivilegeEscalationFails
* sandbox-top-navigation-same-site-no-activation
  * now FramebustingAfterSameSiteNavigationWithoutUserActivationFails
* sandbox-top-navigation-same-site
  * now FramebustingAfterSameSiteNavigationSucceeds

The following tests have duplicates and are being removed altogether:
* sandbox-top-navigation-child-frame-both
  * duplicate of iframe_sandbox_allow_top_navigation-3
* sandbox-top-navigation-child-frame
  * duplicate of iframe_sandbox_allow_top_navigation-1
* sandbox-top-navigation-grandchild-unsandboxed
  * duplicate of sandbox-top-navigation-grandchild-unsandboxed-cross-origin-parent
* sandbox-top-navigation-user-activation-no-sticky
  * duplicate of iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture
* sandbox-top-navigation-user-activation-sticky
  * duplicate of
    iframe_sandbox_allow_top_navigation_by_user_activation-manual

The following tests rely on manual behavior and, while not being
removed, are getting an equivalent browser test:
* iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture
  * now FramebustingWithAllowTopNavigationByUserActivation
* iframe_sandbox_allow_top_navigation_by_user_activation-manual
  * also now FramebustingWithAllowTopNavigationByUserActivation

Bug: 347782854
Change-Id: I3b39a9d51db3dd725c8a88eac0bb464fa4753c04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5813532
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Liam Brady <lbrady@google.com>
Cr-Commit-Position: refs/heads/main@{#1348945}
  • Loading branch information
Liam Brady authored and chromium-wpt-export-bot committed Aug 30, 2024
1 parent 7a69b2e commit daf9128
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 223 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
promise_test(async t => {
const main = await setupTest();
const iframe_1 = await createNestedIframe(
main, 'HTTP_ORIGIN', '', 'allow-top-navigation allow-same-origin');
main, 'HTTP_ORIGIN', '', 'allow-top-navigation allow-same-origin');

await attemptTopNavigation(iframe_1, true);
}, 'A same-origin frame with delivered sandbox flags can navigate top');

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit daf9128

Please sign in to comment.