Bug 1646136 - Improve the comments in the preload/prefetch tests for network state isolation, r=mayhemer
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 24 Jun 2020 16:16:00 +0000
changeset 537192 0fa32f49b4e02b93a74a007b9bd7523818a8954e
parent 537191 49eed7faacd714548b9368fa82b0991075db8db5
child 537193 a60ab910b26878dd9a05738662fecc1d7f5fa49b
push id37537
push userncsoregi@mozilla.com
push dateWed, 24 Jun 2020 21:50:10 +0000
treeherdermozilla-central@1004d422aedb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1646136
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 1646136 - Improve the comments in the preload/prefetch tests for network state isolation, r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D80903
toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js
toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js
--- a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js
+++ b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js
@@ -91,21 +91,26 @@ add_task(async () => {
         fetch("/done").then(() => {});
       }
     </script></body></html>`;
     response.bodyOutputStream.write(body, body.length);
   });
 
   const tests = [
     {
+      // 2 hints because we have 2 different top-level origins, loading the
+      // same resource. This will end up creating 2 separate cache entries.
       hints: 2,
       originAttributes: { partitionKey: "(http,example.org)" },
       prefValue: true,
     },
     {
+      // 1 hint because, with network-state isolation, the cache entry will be
+      // reused for the second loading, even if the top-level origins are
+      // different.
       hints: 1,
       originAttributes: {},
       prefValue: false,
     },
   ];
 
   for (let test of tests) {
     await new Promise(resolve =>
--- a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js
+++ b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js
@@ -93,24 +93,29 @@ add_task(async () => {
         fetch("/done").then(() => {});
       };
     </script></body></html>`;
     response.bodyOutputStream.write(body, body.length);
   });
 
   const tests = [
     {
+      // 2 hints because we have 2 different top-level origins, loading the
+      // same resource. This will end up creating 2 separate cache entries.
+      hints: 2,
       prefValue: true,
       originAttributes: { partitionKey: "(http,example.org)" },
-      hints: 2,
     },
     {
-      prefValue: false,
+      // 1 hint because, with network-state isolation, the cache entry will be
+      // reused for the second loading, even if the top-level origins are
+      // different.
       hints: 1,
       originAttributes: {},
+      prefValue: false,
     },
   ];
 
   for (let test of tests) {
     await new Promise(resolve =>
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, resolve)
     );