Test for breakage

To support testing scenarios during the 1% testing and ramp-up phases of third-party cookie deprecation in Chrome, several Chrome flags are available.

In Chrome 121 and higher, you can simulate the state after third-party cookie phase-out:

  • Enable chrome://flags/#test-third-party-cookie-phaseout
  • Run Chrome from the command line with the flag --test-third-party-cookie-phaseout

This will set Chrome to block third-party cookies, and ensure that new features and mitigations are active.

You can also try browsing with third-party cookies blocked using chrome://settings/cookies, but be aware that the flag ensures the new and updated features are also enabled. Blocking third-party cookies is a good approach to detecting issues, but doesn't necessarily help you validate you have fixed them.

If you maintain an active test suite for your sites, then you should do two side-by-side runs: one with Chrome on the usual settings, and one with the same version of Chrome launched with the --test-third-party-cookie-phaseout flag. Any test failures in the second run and not in the first are good candidates to investigate for third-party cookie dependencies.

Chrome flags for testing different scenarios

In addition to --test-third-party-cookie-phaseout, there are a number of flags available to test different scenarios, such as participation in deprecation trials:

  • All the following flags are supported on Windows, Mac, Linux, ChromeOS, and Android.
  • These flags can be set from the chrome://flags page or from the command line.
  • To set flags for multiple features from the command line with --enable-features or --disable-features, add a comma between each feature name.
  • You can work out the value to use for a command-line flag by setting the flag from chrome://flags, and then viewing Command Line values on the chrome://version page.
Name Purpose Min version chrome://flags Command-line flag
Tracking Protection for 3PCD Enabled: turn on Tracking Protection:
• Show the eye icon UI in the address bar (Omnibox) to allow the user to temporarily enable third-party cookies for a site.
• Provide chrome://settings/trackingProtection instead of chrome://settings/cookies
121 #tracking-protection-3pcd --enable-features=TrackingProtection3pcd

--disable-features=TrackingProtection3pcd
Test Third Party Cookie Phaseout Disabled: this is the default. (No effect.)

Enabled: Restrict third-party cookies and enable Tracking Protection UI to match the behavior of Chrome after third-party cookie phaseout.

This setting overrides the BlockThirdPartyCookies=false Chrome Enterprise policy, but is overridden by content settings, such as those granted by the Storage Access API or the CookiesAllowedForUrls policy.

Flags and settings describes how user settings interact with this flag.
121 #test-third-party-cookie-phaseout --test-third-party-cookie-phaseout
Third-party Cookie Deprecation Trial Grants for Testing Enabled: this is the default. Allow participation in the Third-party cookie deprecation trial. (This flag no longer needs to be set to Enabled to take part in the trial.)

Disabled: make Chrome behave as if a third-party deprecation trial token has not been provided, even if it has. In other words: disable the third-party deprecation trial. This can be useful for testing that longer-term fixes are working, without third-party cookies, on a site participating in the deprecation trial.

To have an effect, this flag requires #tracking-protection-3pcd to be enabled.
121 #third-party-cookie-deprecation-trial --enable-features=TpcdSupportSettings

--disable-features=TpcdSupportSettings
Top-Level Third-Party Cookie Deprecation Trial Grants for Testing Enabled: Required to allow the Top-level third-party cookie deprecation trial.

Disabled: as with the third-party trial, make Chrome behave as if a valid trial token has not been provided, even if it has. In other words: disable the first-party deprecation trial. This can be useful for testing that longer-term fixes are working, without third-party cookies, on a site participating in the first-party deprecation trial.
122 #top-level-third-party-cookie-deprecation-trial --enable-features=TopLevelTpcdSupportSettings

--disable-features=TopLevelTpcdSupportSettings
Third-Party Cookie Deprecation Metadata Grants for Testing Enabled: this is the default. Allow the third-party cookie deprecation trial grace period to take effect.

Disabled: Make Chrome behave as if the grace period is not in effect. This can be used to check that your site has deployed deprecation trial tokens correctly, before the grace period ends (for a site that is subject to the grace period).
121 #tpcd-metadata-grants --enable-features=TpcdMetadataGrants

--disable-features=TpcdMetadataGrants
Third-party Cookie Phase Out Facilitated Testing Enabled: this is the default. Allow a Chrome-facilitated testing group experiment arm to be set for this Chrome client.

Disabled: don't allow an experiment arm to be set by Chrome.

Other values: manually set a specific experiment arm.

Most developers will need to use one of the Enabled Force settings. These bypass eligibility checks and predictably place the Chrome client into the selected group arm. The Enabled settings allow the client to be included in an experiment arm, but don't force inclusion.
121 #tpc-phase-out-facilitated-testing --enable-features=CookieDeprecationFacilitatedTesting

--disable-features=CookieDeprecationFacilitatedTesting

For other values, command-line values depend on the setting. For example, to set Enabled Force Control 1:

--enable-features=CookieDeprecationFacilitatedTesting:force_eligible/true/disable_3p_cookies/false/disable_ads_apis/false/label/fake_control_1%2E1/version/9994

If you need to set these values from the command line, it's probably easiest to set the value from chrome://flags, restart the browser, then copy the flag value from the Command Line section of the chrome://version page.
Third-party Cookie Grants Heuristics Testing Default: allow heuristics-based mitigations.

Enabled: no effect. (Same as Default.)

Disabled: don't allow heuristics-based mitigations. This can be useful for testing that other longer-term fixes (without third-party cookies) are working as expected without heuristics mitigations.

Other flag values are as follows.

CurrentInteraction: require a user interaction on the third-party site during the popup or redirect flow.

ShortRedirect redirect heuristic grants cookie access for 15 minutes: third-party cookies are allowed for redirect scenarios as described in heuristics-based mitigations.

LongRedirect: redirect heuristic grants cookie access for 30 days.

MainFrame:only popups initiated by the main frame can enable the redirect heuristic.

AllFrameInitiator
: popups initiated by any frame can enable the redirect heuristic.
120 #tpcd-heuristics-grants --enable-features=TpcdHeuristicsGrants

--disable-features=TpcdHeuristicsGrants

For other values, set the value from chrome://flags, restart the browser, then copy the flag value from the Command Line section of the chrome://version page.

Flags and settings

Blocking third-party cookies from Chrome user settings has a different effect from the default behavior when using Chrome with the chrome://flags#test-third-party-cookie-phaseout flag enabled.

With only the flag enabled, third-party cookies are handled as they are for Chrome's Tracking Protection test group: third-party cookies are still allowed in short-term, limited cases to allow critical services to function, and also through the longer-term solutions of CHIPS and the Storage Access API.

If Block all third-party cookies from chrome://settings/trackingProtection is enabled (or Block third-party cookies from chrome://settings/cookies, for those not in the Tracking Protection group) Chrome does not allow any access to third-party cookies or other unpartitioned state, unless third-party cookies are allowed by a Chrome Enterprise CookiesAllowedForUrls policy, or the user explicitly grants permission:

  • Using the eye icon in the address bar (Omnibox).
  • Adding an entry under Sites allowed to use third-party cookies on the chrome://settings/trackingProtection page.
  • Adding an entry to Allowed to use third-party cookies on `chrome://settings/cookies.

If the BlockThirdPartyCookies policy is set to false for a Chrome Enterprise user, they won't be able to block third-party cookies from chrome://settings.

Use flag combinations to simulate usage scenarios

Scenario #tracking-protection-3pcd #third-party-cookie-deprecation-trial #tpcd-metadata-grants
1% testing, deprecation trial ignored Enabled Disabled Disabled
Grace period registration approved for domain, but no token yet supplied Enabled Enabled Enabled
Grace period active, token supplied Enabled Enabled Disabled
Grace period no longer active (i.e. after April 2024), token supplied Enabled Enabled [No effect]

Support

Find out more