Bug 1640135 - P5: update tests; r=timhuang
authorLiang-Heng Chen <xeonchen@gmail.com>
Thu, 04 Jun 2020 10:51:28 +0000
changeset 597957 f318f0c9b8f38f9e69eaa587d855f147ecff3e78
parent 597956 64399b8f0d7c0029a4d80b2e723228e7e5347a09
child 597958 4cfcf5a973dafee5b00447dddaca479e3f92dc1b
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstimhuang
bugs1640135
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1640135 - P5: update tests; r=timhuang Differential Revision: https://phabricator.services.mozilla.com/D77918
browser/base/content/test/caps/browser_principalSerialization_csp.js
browser/base/content/test/caps/browser_principalSerialization_version1.js
browser/components/sessionstore/test/browser_sessionStorage.js
toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js
toolkit/components/antitracking/test/browser/dynamicfpi_head.js
toolkit/components/antitracking/test/browser/storageprincipal_head.js
--- a/browser/base/content/test/caps/browser_principalSerialization_csp.js
+++ b/browser/base/content/test/caps/browser_principalSerialization_csp.js
@@ -50,30 +50,32 @@ add_task(async function test_deserialize
         // "cspJSON": "{\"csp-policies\":[{\"child-src\":[\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://www.youtube-nocookie.com\",\"https://trackertest.org\",\"https://www.surveygizmo.com\",\"https://accounts.firefox.com\",\"https://accounts.firefox.com.cn\",\"https://www.youtube.com\"],\"connect-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://accounts.firefox.com/\",\"https://accounts.firefox.com.cn/\"],\"default-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\"],\"frame-src\":[\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://www.youtube-nocookie.com\",\"https://trackertest.org\",\"https://www.surveygizmo.com\",\"https://accounts.firefox.com\",\"https://accounts.firefox.com.cn\",\"https://www.youtube.com\"],\"img-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"data:\",\"https://mozilla.org\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://adservice.google.com\",\"https://adservice.google.de\",\"https://adservice.google.dk\",\"https://creativecommons.org\",\"https://ad.doubleclick.net\"],\"report-only\":false,\"script-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"'unsafe-inline'\",\"'unsafe-eval'\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://tagmanager.google.com\",\"https://www.youtube.com\",\"https://s.ytimg.com\"],\"style-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"'unsafe-inline'\"]}]}",
         URISpec: "https://www.mozilla.org/en-US/",
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
       },
     },
     {
       input:
         "ZT4OTT7kRfqycpfCC8AeuAAAAAAAAAAAwAAAAAAAAEYB3pRy0IA0EdOTmQAQS6D9QJIHOlRteE8wkTq4cYEyCMYAAAAC/////wAAAbsBAAAAL2h0dHBzOi8vd3d3Lm1vemlsbGEub3JnL2VuLVVTL2ZpcmVmb3gvYWNjb3VudHMvAAAAAAAAAAUAAAAIAAAADwAAAAj/////AAAACP////8AAAAIAAAADwAAABcAAAAYAAAAFwAAABgAAAAXAAAAGAAAAC8AAAAAAAAAL/////8AAAAA/////wAAABf/////AAAAF/////8BAAAAAAAAAAAAAAABCdntGuXUQAS/4CfOuSPZrLPEwK69Xkyth+CNIQ27P58B3pRy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AC4AYwBvAG0AIABoAHQAdABwAHMAOgAvAC8AdwB3AHcALgBnAG8AbwBnAGwAZQAtAGEAbgBhAGwAeQB0AGkAYwBzAC4AYwBvAG0AIABoAHQAdABwAHMAOgAvAC8AYQBjAGMAbwB1AG4AdABzAC4AZgBpAHIAZQBmAG8AeAAuAGMAbwBtAC8AIABoAHQAdABwAHMAOgAvAC8AYQBjAGMAbwB1AG4AdABzAC4AZgBpAHIAZQBmAG8AeAAuAGMAbwBtAC4AYwBuAC8AOwAgAGMAaABpAGwAZAAtAHMAcgBjACAAaAB0AHQAcABzADoALwAvAHcAdwB3AC4AZwBvAG8AZwBsAGUAdABhAGcAbQBhAG4AYQBnAGUAcgAuAGMAbwBtACAAaAB0AHQAcABzADoALwAvAHcAdwB3AC4AZwBvAG8AZwBsAGUALQBhAG4AYQBsAHkAdABpAGMAcwAuAGMAbwBtACAAaAB0AHQAcABzADoALwAvAHcAdwB3AC4AeQBvAHUAdAB1AGIAZQAtAG4AbwBjAG8AbwBrAGkAZQAuAGMAbwBtACAAaAB0AHQAcABzADoALwAvAHQAcgBhAGMAawBlAHIAdABlAHMAdAAuAG8AcgBnACAAaAB0AHQAcABzADoALwAvAHcAdwB3AC4AcwB1AHIAdgBlAHkAZwBpAHoAbQBvAC4AYwBvAG0AIABoAHQAdABwAHMAOgAvAC8AYQBjAGMAbwB1AG4AdABzAC4AZgBpAHIAZQBmAG8AeAAuAGMAbwBtACAAaAB0AHQAcABzADoALwAvAGEAYwBjAG8AdQBuAHQAcwAuAGYAaQByAGUAZgBvAHgALgBjAG8AbQAuAGMAbgAgAGgAdAB0AHAAcwA6AC8ALwB3AHcAdwAuAHkAbwB1AHQAdQBiAGUALgBjAG8AbQAA",
       output: {
         URISpec: "https://www.mozilla.org/en-US/firefox/accounts/",
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
         // Within Bug 965637 we removed CSP from Principals. Already serialized Principals however should still deserialize correctly (just without the CSP).
         // "cspJSON": "{\"csp-policies\":[{\"child-src\":[\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://www.youtube-nocookie.com\",\"https://trackertest.org\",\"https://www.surveygizmo.com\",\"https://accounts.firefox.com\",\"https://accounts.firefox.com.cn\",\"https://www.youtube.com\"],\"connect-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://accounts.firefox.com/\",\"https://accounts.firefox.com.cn/\"],\"default-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\"],\"frame-src\":[\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://www.youtube-nocookie.com\",\"https://trackertest.org\",\"https://www.surveygizmo.com\",\"https://accounts.firefox.com\",\"https://accounts.firefox.com.cn\",\"https://www.youtube.com\"],\"img-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"data:\",\"https://mozilla.org\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://adservice.google.com\",\"https://adservice.google.de\",\"https://adservice.google.dk\",\"https://creativecommons.org\",\"https://ad.doubleclick.net\"],\"report-only\":false,\"script-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"'unsafe-inline'\",\"'unsafe-eval'\",\"https://www.googletagmanager.com\",\"https://www.google-analytics.com\",\"https://tagmanager.google.com\",\"https://www.youtube.com\",\"https://s.ytimg.com\"],\"style-src\":[\"'self'\",\"https://*.mozilla.net\",\"https://*.mozilla.org\",\"https://*.mozilla.com\",\"'unsafe-inline'\"]}]}",
       },
     },
   ];
 
   for (let test of serializedPrincipalsFromFirefox) {
--- a/browser/base/content/test/caps/browser_principalSerialization_version1.js
+++ b/browser/base/content/test/caps/browser_principalSerialization_version1.js
@@ -75,58 +75,62 @@ add_task(async function test_realHistory
       output: {
         URI: false,
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
       },
     },
     {
       input:
         "ZT4OTT7kRfqycpfCC8AeuAAAAAAAAAAAwAAAAAAAAEYB3pRy0IA0EdOTmQAQS6D9QJIHOlRteE8wkTq4cYEyCMYAAAAC/////wAAAbsBAAAAe2h0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTLz91dG1fc291cmNlPXd3dy5tb3ppbGxhLm9yZyZ1dG1fbWVkaXVtPXJlZmVycmFsJnV0bV9jYW1wYWlnbj1uYXYmdXRtX2NvbnRlbnQ9ZGV2ZWxvcGVycwAAAAAAAAAFAAAACAAAABUAAAAA/////wAAAAD/////AAAACAAAABUAAAAdAAAAXgAAAB0AAAAHAAAAHQAAAAcAAAAkAAAAAAAAAAD/////AAAAAP////8AAAAlAAAAVgAAAAD/////AQAAAAAAAAAAAAAAAA==",
       output: {
         URISpec:
           "https://developer.mozilla.org/en-US/?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=nav&utm_content=developers",
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
       },
     },
     {
       input: "SmIS26zLEdO3ZQBgsLbOywAAAAAAAAAAwAAAAAAAAEY=",
       output: {
         URI: false,
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
       },
     },
     {
       input:
         "vQZuXxRvRHKDMXv9BbHtkAAAAAAAAAAAwAAAAAAAAEYAAAA4bW96LW51bGxwcmluY2lwYWw6ezA0NWNhMThkLTQzNmMtNDc0NC1iYmI2LWIxYTE1MzY2ZGY3OX0AAAAA",
       output: {
         URISpec: "moz-nullprincipal:{045ca18d-436c-4744-bbb6-b1a15366df79}",
         originAttributes: {
           firstPartyDomain: "",
           inIsolatedMozBrowser: false,
           privateBrowsingId: 0,
           userContextId: 0,
           geckoViewSessionContextId: "",
+          partitionKey: "",
         },
       },
     },
   ];
 
   for (let test of serializedPrincipalsFromFirefox) {
     let principal = E10SUtils.deserializePrincipal(test.input);
 
--- a/browser/components/sessionstore/test/browser_sessionStorage.js
+++ b/browser/components/sessionstore/test/browser_sessionStorage.js
@@ -11,20 +11,20 @@ const URL =
   RAND;
 
 const HAS_FIRST_PARTY_DOMAIN = [
   Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN,
 ].includes(Services.prefs.getIntPref("network.cookie.cookieBehavior"));
 const OUTER_ORIGIN = "http://mochi.test:8888";
 const FIRST_PARTY_DOMAIN = escape("(http,mochi.test)");
 const INNER_ORIGIN = HAS_FIRST_PARTY_DOMAIN
-  ? `http://example.com^firstPartyDomain=${FIRST_PARTY_DOMAIN}`
+  ? `http://example.com^partitionKey=${FIRST_PARTY_DOMAIN}`
   : "http://example.com";
 const SECURE_INNER_ORIGIN = HAS_FIRST_PARTY_DOMAIN
-  ? `https://example.com^firstPartyDomain=${FIRST_PARTY_DOMAIN}`
+  ? `https://example.com^partitionKey=${FIRST_PARTY_DOMAIN}`
   : "https://example.com";
 
 const OUTER_VALUE = "outer-value-" + RAND;
 const INNER_VALUE = "inner-value-" + RAND;
 
 /**
  * This test ensures that setting, modifying and restoring sessionStorage data
  * works as expected.
--- a/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js
+++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js
@@ -57,17 +57,17 @@ add_task(async function() {
       ["network.predictor.enable-prefetch", false],
       ["network.cookie.cookieBehavior", 0],
     ],
   });
 
   const tests = [
     {
       prefValue: true,
-      originAttributes: { firstPartyDomain: "(http,example.org)" },
+      originAttributes: { partitionKey: "(http,example.org)" },
     },
     {
       prefValue: false,
       originAttributes: {},
     },
   ];
 
   for (let test of tests) {
--- a/toolkit/components/antitracking/test/browser/dynamicfpi_head.js
+++ b/toolkit/components/antitracking/test/browser/dynamicfpi_head.js
@@ -64,24 +64,23 @@ this.DynamicFPIHelper = {
           },
         ],
         async obj => {
           await new content.Promise(resolve => {
             let ifr = content.document.createElement("iframe");
             ifr.onload = async _ => {
               await SpecialPowers.spawn(ifr, [], async _ => {
                 is(
-                  content.document.nodePrincipal.originAttributes
-                    .firstPartyDomain,
+                  content.document.nodePrincipal.originAttributes.partitionKey,
                   "",
                   "We don't have first-party set on nodePrincipal"
                 );
                 is(
                   content.document.effectiveStoragePrincipal.originAttributes
-                    .firstPartyDomain,
+                    .partitionKey,
                   "(http,example.net)",
                   "We have first-party set on storagePrincipal"
                 );
               });
               info("Sending code to the 3rd party content");
               ifr.contentWindow.postMessage(obj.callback, "*");
             };
 
--- a/toolkit/components/antitracking/test/browser/storageprincipal_head.js
+++ b/toolkit/components/antitracking/test/browser/storageprincipal_head.js
@@ -66,24 +66,23 @@ this.StoragePrincipalHelper = {
           },
         ],
         async obj => {
           await new content.Promise(resolve => {
             let ifr = content.document.createElement("iframe");
             ifr.onload = async _ => {
               await SpecialPowers.spawn(ifr, [], async _ => {
                 is(
-                  content.document.nodePrincipal.originAttributes
-                    .firstPartyDomain,
+                  content.document.nodePrincipal.originAttributes.partitionKey,
                   "",
                   "We don't have first-party set on nodePrincipal"
                 );
                 is(
                   content.document.effectiveStoragePrincipal.originAttributes
-                    .firstPartyDomain,
+                    .partitionKey,
                   "(http,example.net)",
                   "We have first-party set on storagePrincipal"
                 );
               });
               info("Sending code to the 3rd party content");
               ifr.contentWindow.postMessage(obj.callback, "*");
             };