Nonced cookie partitions should not observe changes to unpartitioned
cookies

We did not filter cookie change events caused by unpartitioend cookies
from listeners set by nonced cookie partitions (e.g. fenced frames).

Bug: 1305105
Change-Id: I1f10b361d096538f6124e57add8c598313eebc22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3553299
Reviewed-by: Maks Orlovich <[email protected]>
Auto-Submit: Dylan Cutler <[email protected]>
Reviewed-by: Shivani Sharma <[email protected]>
Commit-Queue: Shivani Sharma <[email protected]>
Cr-Commit-Position: refs/heads/main@{#985423}
diff --git a/net/cookies/cookie_partition_key_unittest.cc b/net/cookies/cookie_partition_key_unittest.cc
index f3c41a8..b500019 100644
--- a/net/cookies/cookie_partition_key_unittest.cc
+++ b/net/cookies/cookie_partition_key_unittest.cc
@@ -247,6 +247,10 @@
   auto key3 = CookiePartitionKey::FromNetworkIsolationKey(
       NetworkIsolationKey(top_level_site, frame_site, &nonce1));
   EXPECT_EQ(key1, key3);
+
+  auto unnonced_key = CookiePartitionKey::FromNetworkIsolationKey(
+      NetworkIsolationKey(top_level_site, frame_site));
+  EXPECT_NE(key1, unnonced_key);
 }
 
 }  // namespace net