image-tests-data.js (3822B)
1 export const kTestFolderName = "image-tests"; 2 3 // The internal priorities are specified as implementation-defined, 4 // (https://fetch.spec.whatwg.org/#concept-fetch, step 15). For web- 5 // compatibility, Chromium's mapping is chosen 6 // (https://web.dev/articles/fetch-priority#browser_priority_and_fetchpriority). 7 const kExpectedRequestsOfInitialLoad = [ 8 { fileNameAndSuffix: "square_25px_x_25px.png?1", 9 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOWEST 10 }, 11 { fileNameAndSuffix: "square_25px_x_25px.png?2", 12 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH 13 }, 14 { fileNameAndSuffix: "square_25px_x_25px.png?3", 15 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 16 }, 17 { fileNameAndSuffix: "square_25px_x_25px.png?4", 18 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 19 }, 20 ]; 21 22 const kExpectedRequestsOfInitialLoadDisabled = [ 23 { fileNameAndSuffix: "square_25px_x_25px.png?1", 24 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 25 }, 26 { fileNameAndSuffix: "square_25px_x_25px.png?2", 27 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 28 }, 29 { fileNameAndSuffix: "square_25px_x_25px.png?3", 30 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 31 }, 32 { fileNameAndSuffix: "square_25px_x_25px.png?4", 33 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 34 }, 35 ]; 36 37 const kExpectedRequestsOfDynamicLoad = kExpectedRequestsOfInitialLoad; 38 39 const kExpectedRequestsOfDynamicLoadDisabled = kExpectedRequestsOfInitialLoadDisabled; 40 41 const kExpectedRequestsOfInitialLoadForSVGImageTagDisabled = kExpectedRequestsOfInitialLoadDisabled; 42 43 const kExpectedRequestsOfInitialLoadForSVGImageTag = kExpectedRequestsOfInitialLoad; 44 45 const kExpectedRequestsOfDynamicLoadForSVGImageTagDisabled = kExpectedRequestsOfDynamicLoadDisabled; 46 47 const kExpectedRequestsOfDynamicLoadForSVGImageTag = kExpectedRequestsOfInitialLoad; 48 49 const kExpectedRequestsShapeOutsideImage = [ 50 { fileNameAndSuffix: "square_25px_x_25px.png?1", 51 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 52 }, 53 { fileNameAndSuffix: "square_25px_x_25px.png?2", 54 internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_LOW 55 }, 56 ]; 57 58 const kExpectedRequestsShapeOutsideImageDisabled = kExpectedRequestsShapeOutsideImage; 59 60 export const kTestData = [ 61 { testFileName: "image-initial-load.h2.html", 62 expectedRequests: kExpectedRequestsOfInitialLoad 63 }, 64 { testFileName: "image-dynamic-load.h2.html", 65 expectedRequests: kExpectedRequestsOfDynamicLoad 66 }, 67 { testFileName: "image-svg-initial-load.h2.html", 68 expectedRequests: kExpectedRequestsOfInitialLoadForSVGImageTag, 69 }, 70 { testFileName: "image-svg-dynamic-load.h2.html", 71 expectedRequests: kExpectedRequestsOfDynamicLoadForSVGImageTag, 72 }, 73 { testFileName: "shape-outside-image.h2.html", 74 expectedRequests: kExpectedRequestsShapeOutsideImage 75 }, 76 ]; 77 78 export const kTestDataDisabled = [ 79 { testFileName: "image-initial-load.h2.html", 80 expectedRequests: kExpectedRequestsOfInitialLoadDisabled 81 }, 82 { testFileName: "image-dynamic-load.h2.html", 83 expectedRequests: kExpectedRequestsOfDynamicLoadDisabled 84 }, 85 { testFileName: "image-svg-initial-load.h2.html", 86 expectedRequests: kExpectedRequestsOfInitialLoadForSVGImageTagDisabled, 87 }, 88 { testFileName: "image-svg-dynamic-load.h2.html", 89 expectedRequests: kExpectedRequestsOfDynamicLoadForSVGImageTagDisabled, 90 }, 91 { testFileName: "shape-outside-image.h2.html", 92 expectedRequests: kExpectedRequestsShapeOutsideImageDisabled 93 }, 94 ];