Changeset 258632 in webkit
- Timestamp:
- Mar 18, 2020 8:11:09 AM (4 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258627 r258632 1 2020-03-18 Eric Carlson <eric.carlson@apple.com> 2 3 Update some fast/mediastream to make failures easier to diagnose. 4 https://bugs.webkit.org/show_bug.cgi?id=209205 5 <rdar://problem/60561372> 6 7 Log more state when a test fails. 8 9 Reviewed by Alex Christensen. 10 11 * fast/mediastream/MediaStream-video-element-displays-buffer.html: 12 * fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html: 13 * fast/mediastream/resize-trim.html: 14 1 15 2020-03-18 Antoine Quint <graouts@apple.com> 2 16 -
trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer.html
r239319 r258632 30 30 return pixel[0] === 128 && pixel[1] === 128 && pixel[2] === 128 && pixel[3] === 255; 31 31 } 32 33 function checkPixels(x, y, test, expectedToBeTrue) 34 { 35 buffer = context.getImageData(x, y, 1, 1).data; 36 if (expectedToBeTrue) 37 shouldBeTrue(`${test.name}(buffer)`); 38 else 39 shouldBeFalse(`${test.name}(buffer)`); 40 41 if (test(buffer) != expectedToBeTrue) 42 debug(`Found: {${buffer[0]}, ${buffer[1]}, ${buffer[2]}, ${buffer[3]}}`); 43 } 32 44 33 45 function verifyFramesBeingDisplayed() … … 41 53 let x = canvas.width * .035; 42 54 let y = canvas.height * 0.6 + 2 + x; 43 buffer = context.getImageData(x, y, 1, 1).data; 44 shouldBeTrue('isPixelTransparent(buffer)'); 55 checkPixels(x, y, isPixelTransparent, true) 45 56 46 57 evalAndLog(`context.drawImage(videos[${currentTest}], 0, 0, ${canvas.width}, ${canvas.height})`); 47 buffer = context.getImageData(x, y, 1, 1).data; 48 shouldBeFalse('isPixelTransparent(buffer)'); 49 shouldBeFalse('isPixelBlack(buffer)'); 58 checkPixels(x, y, isPixelTransparent, false) 59 checkPixels(x, y, isPixelBlack, false) 50 60 51 61 x = canvas.width * .05; 52 62 y = canvas.height * .05; 53 buffer = context.getImageData(x, y, 1, 1).data; 54 shouldBeFalse('isPixelTransparent(buffer)'); 55 if (!currentTest) 56 shouldBeTrue('isPixelBlack(buffer)'); 57 else 58 shouldBeTrue('isPixelGray(buffer)'); 63 checkPixels(x, y, isPixelTransparent, false) 64 checkPixels(x, y, currentTest ? isPixelGray : isPixelBlack, true) 59 65 60 66 if (currentTest >= 1) { -
trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
r239319 r258632 14 14 let mediaStream; 15 15 let video; 16 let buffer; 16 17 17 let buffer; 18 let timeout; 19 20 function updateWatchdog() 21 { 22 if (timeout) 23 clearTimeout(timeout); 24 25 timeout = setTimeout(() => { 26 console.log("Test took too long, timing out!"); 27 finishJSTest(); 28 }, 30000); 29 } 18 30 19 31 function isPixelBlack(pixel) … … 64 76 debug(''); 65 77 video.pause(); 78 if (timeout) 79 clearTimeout(timeout); 66 80 finishJSTest(); 67 81 } … … 71 85 { 72 86 mediaStream.getVideoTracks()[0].enabled = true; 87 updateWatchdog(); 73 88 debug(`<br> === video track reenabled, should render current frame ===`); 74 89 … … 97 112 { 98 113 mediaStream.getVideoTracks()[0].enabled = false; 114 updateWatchdog(); 99 115 debug('<br> === all video tracks disabled ==='); 100 116 … … 106 122 function beginTestRound() 107 123 { 124 updateWatchdog(); 108 125 debug('<br> === beginning round of pixel tests ==='); 109 126 attempt(10, checkPixels, disableAllTracks); … … 126 143 video = document.querySelector('video'); 127 144 video.addEventListener('canplay', canplay); 145 146 updateWatchdog(); 128 147 129 148 navigator.mediaDevices.getUserMedia({ video : true }) -
trunk/LayoutTests/fast/mediastream/resize-trim.html
r245289 r258632 29 29 ctx.drawImage(video, 0 ,0); 30 30 31 assert_true(isPixelGray(ctx.getImageData(5, 5, 1, 1).data), "Pixel at 5x5 is not black."); 32 assert_true(isPixelGray(ctx.getImageData(10, 200, 1, 1).data), "Pixel at 10x200 is not black."); 31 let pixel = ctx.getImageData(5, 5, 1, 1).data; 32 assert_true(isPixelGray(pixel), `Pixel at 5x5 is not black, found {${pixel[0]}, ${pixel[1]}, ${pixel[2]}, ${pixel[3]}}`); 33 34 pixel = ctx.getImageData(10, 200, 1, 1).data; 35 assert_true(isPixelGray(pixel), `Pixel at 10x200 is not black, found {${pixel[0]}, ${pixel[1]}, ${pixel[2]}, ${pixel[3]}}`); 36 33 37 }, "Video frames are resized in letterbox-mode when captured at non-native size."); 34 38
Note: See TracChangeset
for help on using the changeset viewer.