Skip to content

Commit f367239

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
[Gardener]: disable more flaking CORS issues e2e tests
Bug: 381055647 Change-Id: I53906419e10d9fa079784c9b363a85b5cec542f1 No-Tree-Checks: True Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6055038 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Simon Zünd <[email protected]> Commit-Queue: Jack Franklin <[email protected]> Reviewed-by: Simon Zünd <[email protected]>
1 parent 69f005f commit f367239

File tree

1 file changed

+73
-68
lines changed

1 file changed

+73
-68
lines changed

test/e2e/issues/cors-issues_test.ts

Lines changed: 73 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -362,75 +362,80 @@ describe('CORS issues', () => {
362362
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
363363
});
364364

365-
it('should display CORS requests redirecting to credentialed URLs', async () => {
366-
await goToResource('empty.html');
367-
const {target} = getBrowserAndPages();
368-
await target.evaluate(async () => {
369-
try {
370-
const url = new URL('./issues/credentialed-redirect.rawresponse', document.location.toString())
371-
.toString()
372-
.replace('localhost', 'devtools.oopif.test');
373-
await fetch(url);
374-
} catch (e) {
375-
}
376-
});
377-
await navigateToIssuesTab();
378-
await expandIssue();
379-
const issueElement =
380-
await getIssueByTitle('Ensure CORS requests are not redirected to URLs containing credentials');
381-
assertNotNullOrUndefined(issueElement);
382-
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
383-
const text = await section.label.evaluate(el => el.textContent);
384-
assert.strictEqual(text, '1 request');
385-
await ensureResourceSectionIsExpanded(section);
386-
const expectedTableRows = [
387-
[
388-
'Request',
389-
'Status',
390-
],
391-
[
392-
'credentialed-redirect.rawresponse',
393-
'blocked',
394-
],
395-
];
396-
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
397-
});
365+
// Flakey on Windows only after a recent Chromium roll
366+
it.skipOnPlatforms(
367+
['win32'], '[crbug.com/381055647] should display CORS requests redirecting to credentialed URLs', async () => {
368+
await goToResource('empty.html');
369+
const {target} = getBrowserAndPages();
370+
await target.evaluate(async () => {
371+
try {
372+
const url = new URL('./issues/credentialed-redirect.rawresponse', document.location.toString())
373+
.toString()
374+
.replace('localhost', 'devtools.oopif.test');
375+
await fetch(url);
376+
} catch (e) {
377+
}
378+
});
379+
await navigateToIssuesTab();
380+
await expandIssue();
381+
const issueElement =
382+
await getIssueByTitle('Ensure CORS requests are not redirected to URLs containing credentials');
383+
assertNotNullOrUndefined(issueElement);
384+
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
385+
const text = await section.label.evaluate(el => el.textContent);
386+
assert.strictEqual(text, '1 request');
387+
await ensureResourceSectionIsExpanded(section);
388+
const expectedTableRows = [
389+
[
390+
'Request',
391+
'Status',
392+
],
393+
[
394+
'credentialed-redirect.rawresponse',
395+
'blocked',
396+
],
397+
];
398+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
399+
});
398400

399-
it('should display CORS issues that are disallowed by the mode', async () => {
400-
await goToResource('empty.html');
401-
const {target} = getBrowserAndPages();
402-
await target.evaluate(async () => {
403-
try {
404-
const url = new URL('/', document.location.toString()).toString().replace('localhost', 'devtools.oopif.test');
405-
await fetch(url, {mode: 'same-origin'});
406-
} catch (e) {
407-
}
408-
});
409-
await navigateToIssuesTab();
410-
await expandIssue();
411-
const issueElement =
412-
await getIssueByTitle('Ensure only same-origin resources are fetched with same-origin request mode');
413-
assertNotNullOrUndefined(issueElement);
414-
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
415-
const text = await section.label.evaluate(el => el.textContent);
416-
assert.strictEqual(text, '1 request');
417-
await ensureResourceSectionIsExpanded(section);
418-
const expectedTableRows = [
419-
[
420-
'Request',
421-
'Status',
422-
'Initiator Context',
423-
'Source Location',
424-
],
425-
[
426-
/^devtools.oopif.test.*\//,
427-
'blocked',
428-
/^https:\/\/localhost.*/,
429-
/.*:\d+/,
430-
],
431-
];
432-
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
433-
});
401+
// Flakey on Windows only after a recent Chromium roll
402+
it.skipOnPlatforms(
403+
['win32'], '[crbug.com/381055647] should display CORS issues that are disallowed by the mode', async () => {
404+
await goToResource('empty.html');
405+
const {target} = getBrowserAndPages();
406+
await target.evaluate(async () => {
407+
try {
408+
const url =
409+
new URL('/', document.location.toString()).toString().replace('localhost', 'devtools.oopif.test');
410+
await fetch(url, {mode: 'same-origin'});
411+
} catch (e) {
412+
}
413+
});
414+
await navigateToIssuesTab();
415+
await expandIssue();
416+
const issueElement =
417+
await getIssueByTitle('Ensure only same-origin resources are fetched with same-origin request mode');
418+
assertNotNullOrUndefined(issueElement);
419+
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
420+
const text = await section.label.evaluate(el => el.textContent);
421+
assert.strictEqual(text, '1 request');
422+
await ensureResourceSectionIsExpanded(section);
423+
const expectedTableRows = [
424+
[
425+
'Request',
426+
'Status',
427+
'Initiator Context',
428+
'Source Location',
429+
],
430+
[
431+
/^devtools.oopif.test.*\//,
432+
'blocked',
433+
/^https:\/\/localhost.*/,
434+
/.*:\d+/,
435+
],
436+
];
437+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
438+
});
434439

435440
// Flakey on Windows only after a recent Chromium roll
436441
it.skipOnPlatforms(

0 commit comments

Comments
 (0)