Skip to content

Commit

Permalink
tests: use origin-agent-cluster to actually test oopifs (#13777)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Apr 1, 2022
1 parent 1b3f8e1 commit 4e35cc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
5 changes: 4 additions & 1 deletion lighthouse-cli/test/fixtures/static-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ class Server {
// Used by Smokerider.
if (this._dataTransformer) data = this._dataTransformer(data);

const headers = {'Access-Control-Allow-Origin': '*'};
const headers = {
'Access-Control-Allow-Origin': '*',
'Origin-Agent-Cluster': '?1',
};

const contentType = mime.lookup(filePath);
const charset = mime.lookup(contentType);
Expand Down
15 changes: 2 additions & 13 deletions lighthouse-cli/test/smokehouse/test-definitions/oopif-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,16 @@ const expectations = {
isPositionFixed: true,
},
],
// Only `oopif-simple-page.html`'s inclusion of `simple-script.js` should show up here.
// Only `:10200/oopif-simple-page.html`'s inclusion of `simple-script.js` shows here.
// All other scripts are filtered out because of our "OOPIF" filter (including anything
// that is just in another process, like a worker).
ScriptElements: [
{
src: 'http://localhost:10200/simple-script.js',
source: 'network',
},
{
src: 'http://localhost:10503/simple-script.js',
source: 'network',
},
],
// Same here, except we get inline scripts of the iframe.
Scripts: {
_includes: [
{
Expand All @@ -125,14 +122,6 @@ const expectations = {
url: 'http://localhost:10200/oopif-simple-page.html',
content: /new Worker/,
},
{
url: 'http://localhost:10503/simple-script.js',
content: /🪁/,
},
{
url: 'http://localhost:10503/oopif-simple-page.html',
content: /new Worker/,
},
],
_excludes: [{}],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const expectations = {
audits: {
'resource-summary': {
score: null,
displayValue: '10 requests • 164 KiB',
displayValue: '10 requests • 165 KiB',
details: {
items: [
{resourceType: 'total', requestCount: 10, transferSize: '168000±1000'},
Expand All @@ -86,7 +86,7 @@ const expectations = {
{
resourceType: 'total',
countOverBudget: '2 requests',
sizeOverBudget: '65000±1000',
sizeOverBudget: '66000±1000',
},
{
resourceType: 'script',
Expand All @@ -101,7 +101,7 @@ const expectations = {
{
resourceType: 'document',
countOverBudget: '1 request',
sizeOverBudget: '1200±50',
sizeOverBudget: '1250±50',
},
{
resourceType: 'stylesheet',
Expand Down

0 comments on commit 4e35cc0

Please sign in to comment.