@@ -70,41 +70,45 @@ describe('CORS issues', () => {
7070 await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
7171 } ) ;
7272
73- it ( 'should display credentialed+wildcard CORS issues with the correct affected resources' , async ( ) => {
74- await goToResource ( 'empty.html' ) ;
75- const { target} = getBrowserAndPages ( ) ;
76- await target . evaluate ( async ( ) => {
77- try {
78- const url = new URL ( './issues/origin-wildcard.rawresponse' , document . location . toString ( ) )
79- . toString ( )
80- . replace ( 'localhost' , 'devtools.oopif.test' ) ;
81- await fetch ( url , { credentials : 'include' } ) ;
82- } catch ( e ) {
83- }
84- } ) ;
85- await navigateToIssuesTab ( ) ;
86- await expandIssue ( ) ;
87- const issueElement =
88- await getIssueByTitle ( 'Ensure credentialed requests are not sent to CORS resources with origin wildcards' ) ;
89- assertNotNullOrUndefined ( issueElement ) ;
90- const section = await getResourcesElement ( 'request' , issueElement , '.cors-issue-affected-resource-label' ) ;
91- const text = await section . label . evaluate ( el => el . textContent ) ;
92- assert . strictEqual ( text , '1 request' ) ;
93- await ensureResourceSectionIsExpanded ( section ) ;
94- const expectedTableRows = [
95- [
96- 'Request' ,
97- 'Status' ,
98- 'Preflight Request (if problematic)' ,
99- ] ,
100- [
101- 'origin-wildcard.rawresponse' ,
102- 'blocked' ,
103- '' ,
104- ] ,
105- ] ;
106- await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
107- } ) ;
73+ // Flakey on Windows only after a recent Chromium roll
74+ it . skipOnPlatforms (
75+ [ 'win32' ] ,
76+ '[crbug.com/381055647] should display credentialed+wildcard CORS issues with the correct affected resources' ,
77+ async ( ) => {
78+ await goToResource ( 'empty.html' ) ;
79+ const { target} = getBrowserAndPages ( ) ;
80+ await target . evaluate ( async ( ) => {
81+ try {
82+ const url = new URL ( './issues/origin-wildcard.rawresponse' , document . location . toString ( ) )
83+ . toString ( )
84+ . replace ( 'localhost' , 'devtools.oopif.test' ) ;
85+ await fetch ( url , { credentials : 'include' } ) ;
86+ } catch ( e ) {
87+ }
88+ } ) ;
89+ await navigateToIssuesTab ( ) ;
90+ await expandIssue ( ) ;
91+ const issueElement =
92+ await getIssueByTitle ( 'Ensure credentialed requests are not sent to CORS resources with origin wildcards' ) ;
93+ assertNotNullOrUndefined ( issueElement ) ;
94+ const section = await getResourcesElement ( 'request' , issueElement , '.cors-issue-affected-resource-label' ) ;
95+ const text = await section . label . evaluate ( el => el . textContent ) ;
96+ assert . strictEqual ( text , '1 request' ) ;
97+ await ensureResourceSectionIsExpanded ( section ) ;
98+ const expectedTableRows = [
99+ [
100+ 'Request' ,
101+ 'Status' ,
102+ 'Preflight Request (if problematic)' ,
103+ ] ,
104+ [
105+ 'origin-wildcard.rawresponse' ,
106+ 'blocked' ,
107+ '' ,
108+ ] ,
109+ ] ;
110+ await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
111+ } ) ;
108112
109113 it ( 'should display invalid CORS preflight response codes with the correct affected resources' , async ( ) => {
110114 await goToResource ( 'empty.html' ) ;
@@ -313,46 +317,50 @@ describe('CORS issues', () => {
313317 await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
314318 } ) ;
315319
316- it ( 'should display CORS requests using disallowed headers with the correct affected resources' , async ( ) => {
317- await goToResource ( 'empty.html' ) ;
318- const { target} = getBrowserAndPages ( ) ;
319- await target . evaluate ( async ( ) => {
320- try {
321- // We can re-use `method-disallowed.rawresponse` for this test.
322- const url = new URL ( './issues/method-disallowed.rawresponse' , document . location . toString ( ) )
323- . toString ( )
324- . replace ( 'localhost' , 'devtools.oopif.test' ) ;
325- await fetch ( url , {
326- headers : { 'X-Foo' : 'bar' } ,
320+ // Flakey on Windows only after a recent Chromium roll
321+ it . skipOnPlatforms (
322+ [ 'win32' ] ,
323+ '[crbug.com/381055647] should display CORS requests using disallowed headers with the correct affected resources' ,
324+ async ( ) => {
325+ await goToResource ( 'empty.html' ) ;
326+ const { target} = getBrowserAndPages ( ) ;
327+ await target . evaluate ( async ( ) => {
328+ try {
329+ // We can re-use `method-disallowed.rawresponse` for this test.
330+ const url = new URL ( './issues/method-disallowed.rawresponse' , document . location . toString ( ) )
331+ . toString ( )
332+ . replace ( 'localhost' , 'devtools.oopif.test' ) ;
333+ await fetch ( url , {
334+ headers : { 'X-Foo' : 'bar' } ,
335+ } ) ;
336+ } catch ( e ) {
337+ }
327338 } ) ;
328- } catch ( e ) {
329- }
330- } ) ;
331- await navigateToIssuesTab ( ) ;
332- await expandIssue ( ) ;
333- const issueElement = await getIssueByTitle ( 'Ensure CORS request includes only allowed headers' ) ;
334- assertNotNullOrUndefined ( issueElement ) ;
335- const section = await getResourcesElement ( 'request' , issueElement , '.cors-issue-affected-resource-label' ) ;
336- const text = await section . label . evaluate ( el => el . textContent ) ;
337- assert . strictEqual ( text , '1 request' ) ;
338- await ensureResourceSectionIsExpanded ( section ) ;
339+ await navigateToIssuesTab ( ) ;
340+ await expandIssue ( ) ;
341+ const issueElement = await getIssueByTitle ( 'Ensure CORS request includes only allowed headers' ) ;
342+ assertNotNullOrUndefined ( issueElement ) ;
343+ const section = await getResourcesElement ( 'request' , issueElement , '.cors-issue-affected-resource-label' ) ;
344+ const text = await section . label . evaluate ( el => el . textContent ) ;
345+ assert . strictEqual ( text , '1 request' ) ;
346+ await ensureResourceSectionIsExpanded ( section ) ;
339347
340- const expectedTableRows = [
341- [
342- 'Request' ,
343- 'Status' ,
344- 'Preflight Request' ,
345- 'Disallowed Request Header' ,
346- ] ,
347- [
348- 'method-disallowed.rawresponse' ,
349- 'blocked' ,
350- 'method-disallowed.rawresponse' ,
351- 'x-foo' ,
352- ] ,
353- ] ;
354- await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
355- } ) ;
348+ const expectedTableRows = [
349+ [
350+ 'Request' ,
351+ 'Status' ,
352+ 'Preflight Request' ,
353+ 'Disallowed Request Header' ,
354+ ] ,
355+ [
356+ 'method-disallowed.rawresponse' ,
357+ 'blocked' ,
358+ 'method-disallowed.rawresponse' ,
359+ 'x-foo' ,
360+ ] ,
361+ ] ;
362+ await waitForTableFromResourceSectionContents ( section . content , expectedTableRows ) ;
363+ } ) ;
356364
357365 it ( 'should display CORS requests redirecting to credentialed URLs' , async ( ) => {
358366 await goToResource ( 'empty.html' ) ;
0 commit comments