chromium/components/policy/test/data/pref_mapping/RelatedWebsiteSetsOverrides.json

[
  {
    "os": [
      "win",
      "linux",
      "mac",
      "chromeos_ash",
      "chromeos_lacros",
      "android",
      "fuchsia"
    ],
    "policy_pref_mapping_tests": [
      {
        "note": "Default value (no policies set)",
        "prefs": {
          "first_party_sets.overrides": {
            "default_value": {},
            "location": "user_profile"
          }
        }
      },
      {
        "note": "Empty policy.",
        "policies": {},
        "prefs": {
          "first_party_sets.overrides": {
            "default_value": {},
            "location": "user_profile"
          }
        }
      },
      {
        "note": "Invalid policy, violates policy schema.",
        "policies": {
          "RelatedWebsiteSetsOverrides": {
            "additions": 123,
            "replacements": "clearly not a list"
          }
        },
        "prefs": {
          "first_party_sets.overrides": {
            "default_value": {},
            "location": "user_profile"
          }
        }
      },
      {
        "note": "Invalid policy, violates Related Website Sets invariants.",
        "policies": {
          "RelatedWebsiteSetsOverrides": {
            "additions": [
              {
                "associatedSites": [
                  "https://associate2.test"
                ],
                "primary": "https://primary1.test"
              }
            ],
            "replacements": [
              {
                "associatedSites": [
                  "https://associate1.test"
                ],
                "primary": "https://primary1.test"
              }
            ]
          }
        },
        "prefs": {
          "first_party_sets.overrides": {
            "default_value": {},
            "location": "user_profile"
          }
        }
      },
      {
        "note": "Check when FirstPartySetsOverrides is set with properly formatted replacements and additions policy set lists.",
        "policies": {
          "FirstPartySetsOverrides": {
            "additions": [
              {
                "associatedSites": [
                  "https://associate2.test"
                ],
                "primary": "https://primary2.test"
              }
            ],
            "replacements": [
              {
                "associatedSites": [
                  "https://associate1.test"
                ],
                "primary": "https://primary1.test"
              }
            ]
          }
        },
        "prefs": {
          "first_party_sets.overrides": {
            "location": "user_profile",
            "value": {
              "additions": [
                {
                  "associatedSites": [
                    "https://associate2.test"
                  ],
                  "primary": "https://primary2.test"
                }
              ],
              "replacements": [
                {
                  "associatedSites": [
                    "https://associate1.test"
                  ],
                  "primary": "https://primary1.test"
                }
              ]
            }
          }
        }
      },
      {
        "note": "Check when RelatedWebsiteSetsOverrides is set with properly formatted replacements and additions policy set lists.",
        "policies": {
          "RelatedWebsiteSetsOverrides": {
            "additions": [
              {
                "associatedSites": [
                  "https://associate2.test"
                ],
                "primary": "https://primary2.test"
              }
            ],
            "replacements": [
              {
                "associatedSites": [
                  "https://associate1.test"
                ],
                "primary": "https://primary1.test"
              }
            ]
          }
        },
        "prefs": {
          "first_party_sets.overrides": {
            "location": "user_profile",
            "value": {
              "additions": [
                {
                  "associatedSites": [
                    "https://associate2.test"
                  ],
                  "primary": "https://primary2.test"
                }
              ],
              "replacements": [
                {
                  "associatedSites": [
                    "https://associate1.test"
                  ],
                  "primary": "https://primary1.test"
                }
              ]
            }
          }
        }
      },
      {
        "note": "Check when FirstPartySetsOverrides and RelatedWebsiteSetsOverrides are both set.",
        "policies": {
          "FirstPartySetsOverrides": {
            "additions": [
              {
                "associatedSites": [
                  "https://associate2-FPS.test"
                ],
                "primary": "https://primary2-FPS.test"
              }
            ],
            "replacements": [
              {
                "associatedSites": [
                  "https://associate1-FPS.test"
                ],
                "primary": "https://primary1-FPS.test"
              }
            ]
          },
          "RelatedWebsiteSetsOverrides": {
            "additions": [
              {
                "associatedSites": [
                  "https://associate2-RWS.test"
                ],
                "primary": "https://primary2-RWS.test"
              }
            ],
            "replacements": [
              {
                "associatedSites": [
                  "https://associate1-RWS.test"
                ],
                "primary": "https://primary1-RWS.test"
              }
            ]
          }
        },
        "prefs": {
          "first_party_sets.overrides": {
            "location": "user_profile",
            "value": {
              "additions": [
                {
                  "associatedSites": [
                    "https://associate2-RWS.test"
                  ],
                  "primary": "https://primary2-RWS.test"
                }
              ],
              "replacements": [
                {
                  "associatedSites": [
                    "https://associate1-RWS.test"
                  ],
                  "primary": "https://primary1-RWS.test"
                }
              ]
            }
          }
        }
      }
    ]
  }
]