Skip to content

Commit

Permalink
tests: update network target type expectations (#16273)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine authored Dec 3, 2024
1 parent ac14d36 commit 93d77b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions cli/test/smokehouse/test-definitions/oopif-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ const expectations = {
// From in-process iframe
{url: 'http://localhost:10200/simple-script.js', resourceType: 'Script', sessionTargetType: 'page'},
{url: 'http://localhost:10200/simple-script.js', resourceType: 'Fetch', sessionTargetType: 'page'},
{url: 'http://localhost:10200/simple-worker.js', sessionTargetType: 'page'},
// This target type can vary depending on if Chrome's field trial config is being used
// The target type of worker requests can vary depending on the Chrome version and if
// the field trial config is being used.
{url: 'http://localhost:10200/simple-worker.js', sessionTargetType: /(page|worker)/},
{url: 'http://localhost:10200/simple-worker.mjs', sessionTargetType: /(page|worker)/},
// From in-process iframe -> simple-worker.js
{url: 'http://localhost:10200/simple-script.js?importScripts', resourceType: 'Other', sessionTargetType: 'worker'},
Expand All @@ -61,8 +62,9 @@ const expectations = {
// From OOPIF
{url: 'http://localhost:10503/simple-script.js', resourceType: 'Script', sessionTargetType: 'iframe'},
{url: 'http://localhost:10503/simple-script.js', resourceType: 'Fetch', sessionTargetType: 'iframe'},
{url: 'http://localhost:10503/simple-worker.js', sessionTargetType: 'iframe'},
// This target type can vary depending on if Chrome's field trial config is being used
// The target type of worker requests can vary depending on the Chrome version and if
// the field trial config is being used.
{url: 'http://localhost:10503/simple-worker.js', sessionTargetType: /(iframe|worker)/},
{url: 'http://localhost:10503/simple-worker.mjs', sessionTargetType: /(iframe|worker)/},
// From OOPIF -> simple-worker.js
{url: 'http://localhost:10503/simple-script.js?importScripts', resourceType: 'Other', sessionTargetType: 'worker'},
Expand Down
15 changes: 8 additions & 7 deletions core/test/scenarios/api-test-pptr.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ describe('Individual modes API', function() {
.sort((a, b) => a.url.localeCompare(b.url));

// These results can change depending on which Chrome version is used.
// The expectation here is tuned for ToT Chromium WITHOUT the `--disable-field-trial-config`
// The expectation here is tuned for Chromium 133.0.6876.0
//
// Adding the `--disable-field-trial-config` flag or using Chrome canary can change which
// target the root worker requests are associated with.
// Using an older Chromium version can change which target the root
// worker requests are associated with.
// (also depends on --disable-field-trial-config for older versions)
expect(networkRequests).toMatchInlineSnapshot(`
Array [
Object {
Expand All @@ -210,11 +211,11 @@ Array [
"url": "http://localhost:10200/simple-script.js?importScripts",
},
Object {
"sessionTargetType": "page",
"sessionTargetType": "worker",
"url": "http://localhost:10200/simple-worker.js",
},
Object {
"sessionTargetType": "page",
"sessionTargetType": "worker",
"url": "http://localhost:10200/simple-worker.mjs",
},
Object {
Expand All @@ -230,11 +231,11 @@ Array [
"url": "http://localhost:10503/simple-script.js?importScripts",
},
Object {
"sessionTargetType": "iframe",
"sessionTargetType": "worker",
"url": "http://localhost:10503/simple-worker.js",
},
Object {
"sessionTargetType": "iframe",
"sessionTargetType": "worker",
"url": "http://localhost:10503/simple-worker.mjs",
},
]
Expand Down

0 comments on commit 93d77b3

Please sign in to comment.