Changeset 228017 in webkit
- Timestamp:
- Feb 2, 2018 10:51:37 AM (6 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 1 added
- 1 deleted
- 11 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228010 r228017 1 2018-02-02 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Turn media/modern-media-controls/volume-* back on 4 https://bugs.webkit.org/show_bug.cgi?id=182438 5 6 Reviewed by Dean Jackson. 7 8 Update tests to match the modern-media-controls design and expectations. 9 One test was reworked as a Slider test since VolumeSlider no longer exists. 10 11 * media/modern-media-controls/slider/slider-value-expected.txt: Renamed from LayoutTests/media/modern-media-controls/volume-slider/volume-slider-value-expected.txt. 12 * media/modern-media-controls/slider/slider-value.html: Renamed from LayoutTests/media/modern-media-controls/volume-slider/volume-slider-value.html. 13 * media/modern-media-controls/volume-down-support/volume-down-support-expected.txt: 14 * media/modern-media-controls/volume-down-support/volume-down-support.html: 15 * media/modern-media-controls/volume-slider/volume-slider-expected.txt: Removed. 16 * media/modern-media-controls/volume-slider/volume-slider-value-expected.txt: Removed. 17 * media/modern-media-controls/volume-slider/volume-slider.html: Removed. 18 * media/modern-media-controls/volume-support/volume-support-click-expected.txt: 19 * media/modern-media-controls/volume-support/volume-support-click.html: 20 * media/modern-media-controls/volume-support/volume-support-drag-expected.txt: 21 * media/modern-media-controls/volume-support/volume-support-drag.html: 22 * media/modern-media-controls/volume-up-support/volume-up-support-expected.txt: 23 * media/modern-media-controls/volume-up-support/volume-up-support.html: 24 * platform/ios/TestExpectations: 25 * platform/mac/TestExpectations: 26 1 27 2018-02-02 Antoine Quint <graouts@apple.com> 2 28 -
trunk/LayoutTests/media/modern-media-controls/slider/slider-value.html
r228015 r228017 1 1 <script src="../../../resources/js-test-pre.js"></script> 2 2 <script src="../resources/media-controls-loader.js" type="text/javascript"></script> 3 <style type="text/css" media="screen"> 4 .slider { position: absolute; } 5 </style> 3 6 <body> 4 7 <script type="text/javascript"> 5 8 6 description("Testing the <code> VolumeSlider</code> value property.");9 description("Testing the <code>Slider</code> value property."); 7 10 8 11 window.jsTestIsAsync = true; 9 12 10 const slider = new VolumeSlider; 13 const KNOB_WIDTH = 9; 14 15 const slider = new Slider; 11 16 slider.x = 10; 12 17 slider.y = 32; 13 slider.width = 200 ;18 slider.width = 200 + KNOB_WIDTH; 14 19 15 20 slider.uiDelegate = { … … 37 42 function dragSlider(fromPx, toPx) { 38 43 const bounds = input.getBoundingClientRect(); 39 const minX = bounds.left ;44 const minX = bounds.left + KNOB_WIDTH / 2; 40 45 const centerY = bounds.top + bounds.height / 2; 41 46 -
trunk/LayoutTests/media/modern-media-controls/volume-down-support/volume-down-support-expected.txt
r213258 r228017 4 4 5 5 6 PASS !! window.internals.shadowRoot(media).lastChild.querySelector("button.volume-down") became true6 PASS !!internals.shadowRoot(media).querySelector("button.volume-down") became true 7 7 PASS media.webkitDisplayingFullscreen is true 8 PASS media.volume is 1 8 PASS media.volume is 0.5 9 PASS volumeSlider.getBoundingClientRect().left became 196 9 10 10 11 Pressing on the volume down button 11 PASS media.volume is within 0.1 of012 PASS media.volume is 0 12 13 13 14 PASS successfullyParsed is true -
trunk/LayoutTests/media/modern-media-controls/volume-down-support/volume-down-support.html
r217275 r228017 3 3 <script src="../resources/media-controls-utils.js" type="text/javascript"></script> 4 4 <body> 5 <button id="fullscreen" style="position: absolute; left: 0; top: 0;">Enter fullscreen</button> 5 6 <video src="../../content/test.mp4" style="width: 320px; height: 240px;" controls></video> 6 <div id="shadow"></div>7 7 <script type="text/javascript"> 8 8 … … 12 12 13 13 const media = document.querySelector("video"); 14 const button = document. body.appendChild(document.createElement("button"));14 const button = document.querySelector("#fullscreen"); 15 15 16 button.addEventListener("click", () => media.webkitEnterFullscreen());16 media.volume = 0.5; 17 17 18 function enterFullscreen() 19 { 20 if (!("eventSender" in window)) { 21 debug("This test is designed to run in DRT"); 22 return; 23 } 24 25 // Click a button so we may enter fullscreen. 26 button.addEventListener("click", event => { 27 try { 28 media.webkitEnterFullscreen(); 29 } catch(e) { 30 debug("Toggling fullscreen failed"); 31 finishJSTest(); 32 } 33 }); 34 35 pressOnElement(button); 36 } 37 38 let volumeDownButton, volumeSlider; 18 39 media.addEventListener("loadedmetadata", () => { 19 pressOnElement(button);20 shouldBecomeEqual('!! window.internals.shadowRoot(media).lastChild.querySelector("button.volume-down")', "true", () => {40 enterFullscreen(); 41 shouldBecomeEqual('!!internals.shadowRoot(media).querySelector("button.volume-down")', "true", () => { 21 42 shouldBeTrue("media.webkitDisplayingFullscreen"); 22 shouldBe("media.volume", " 1");43 shouldBe("media.volume", "0.5"); 23 44 24 shouldBeCloseTo("media.volume", "0", () => { 45 volumeDownButton = internals.shadowRoot(media).querySelector("button.volume-down"); 46 volumeSlider = internals.shadowRoot(media).querySelector(".slider.volume"); 47 48 shouldBecomeEqual('volumeSlider.getBoundingClientRect().left', "196", () => { 49 media.addEventListener("volumechange", () => { 50 shouldBe("media.volume", "0"); 51 debug(""); 52 media.remove(); 53 button.remove(); 54 finishJSTest(); 55 }); 56 25 57 debug(""); 26 media.remove(); 27 button.remove(); 28 finishJSTest(); 58 debug("Pressing on the volume down button"); 59 pressOnElement(volumeDownButton); 29 60 }); 30 31 debug("");32 debug("Pressing on the volume down button");33 pressOnElement(window.internals.shadowRoot(media).lastElementChild.lastElementChild.querySelector("button.volume-down"));34 61 }); 35 62 }); -
trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click-expected.txt
r212861 r228017 5 5 6 6 PASS mediaController.controls.volumeSlider.parent.visible is true 7 PASS media.volume is 0.5 7 PASS media.volume is 0.51 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click.html
r212943 r228017 56 56 57 57 media.addEventListener("volumechange", () => { 58 shouldBe("media.volume", "0.5"); 58 // Because the slider has a 9pt-wide knob and tests are ran at 1x, we can't get 0.5 here, and instead get 0.51 since 59 // the slider will only increment on whole pixels. 60 shouldBe("media.volume", "0.51"); 59 61 container.remove(); 60 62 media.remove(); -
trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag-expected.txt
r213317 r228017 14 14 We initiated a volume slider drag, the media should no longer be muted and the volume set 15 15 PASS media.muted became false 16 PASS media.volume became 0.5 16 PASS media.volume became 0.51 17 17 18 18 We finished dragging to set the volume to 1 -
trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag.html
r213317 r228017 57 57 debug("We initiated a volume slider drag, the media should no longer be muted and the volume set"); 58 58 shouldBecomeEqual("media.muted", "false", () => { 59 shouldBecomeEqual("media.volume", "0.5", () => { 59 // Because the slider has a 9pt-wide knob and tests are ran at 1x, we can't get 0.5 here, 60 // and instead get 0.51 since the slider will only increment on whole pixels. 61 shouldBecomeEqual("media.volume", "0.51", () => { 60 62 for (let i = 1; i <= iterations; ++i) 61 63 eventSender.mouseMoveTo(bounds.left + bounds.width / 2, dragStartY + i * Math.sign(delta)); … … 79 81 }); 80 82 83 setTimeout(finishJSTest, 3500); 84 81 85 </script> 82 86 <script src="../../../resources/js-test-post.js"></script> -
trunk/LayoutTests/media/modern-media-controls/volume-up-support/volume-up-support-expected.txt
r218600 r228017 4 4 5 5 6 PASS !!window.internals.shadowRoot(media).querySelector('button.volume-up') became true 6 PASS !!internals.shadowRoot(media).querySelector("button.volume-up") became true 7 PASS media.webkitDisplayingFullscreen is true 7 8 PASS media.volume is 0.5 9 PASS volumeSlider.getBoundingClientRect().left became 196 8 10 9 11 Pressing on the volume up button -
trunk/LayoutTests/media/modern-media-controls/volume-up-support/volume-up-support.html
r218600 r228017 3 3 <script src="../resources/media-controls-utils.js" type="text/javascript"></script> 4 4 <body> 5 <button id="fullscreen" style="position: absolute; left: 0; top: 0;">Enter fullscreen</button> 5 6 <video src="../../content/test.mp4" style="width: 320px; height: 240px;" controls></video> 6 <div id="shadow"></div>7 7 <script type="text/javascript"> 8 8 … … 12 12 13 13 const media = document.querySelector("video"); 14 const button = document. body.appendChild(document.createElement("button"));14 const button = document.querySelector("#fullscreen"); 15 15 16 16 media.volume = 0.5; 17 17 18 media.addEventListener("webkitfullscreenchange", function() { 19 if (media.webkitDisplayingFullscreen) { 20 shouldBecomeEqual("!!window.internals.shadowRoot(media).querySelector('button.volume-up')", "true", () => { 21 shouldBe("media.volume", "0.5"); 22 23 media.addEventListener("volumechange", () => { 24 shouldBe("media.volume", "1"); 25 debug(""); 26 media.remove(); 27 button.remove(); 28 finishJSTest(); 29 }); 30 31 debug(""); 32 debug("Pressing on the volume up button"); 33 pressOnElement(window.internals.shadowRoot(media).querySelector("button.volume-up")); 34 }); 35 } 36 }); 37 38 media.addEventListener("loadedmetadata", () => { 18 function enterFullscreen() 19 { 39 20 if (!("eventSender" in window)) { 40 21 debug("This test is designed to run in DRT"); … … 53 34 54 35 pressOnElement(button); 36 } 37 38 let volumeUpButton, volumeSlider; 39 media.addEventListener("loadedmetadata", () => { 40 enterFullscreen(); 41 shouldBecomeEqual('!!internals.shadowRoot(media).querySelector("button.volume-up")', "true", () => { 42 shouldBeTrue("media.webkitDisplayingFullscreen"); 43 shouldBe("media.volume", "0.5"); 44 45 volumeUpButton = internals.shadowRoot(media).querySelector("button.volume-up"); 46 volumeSlider = internals.shadowRoot(media).querySelector(".slider.volume"); 47 48 shouldBecomeEqual('volumeSlider.getBoundingClientRect().left', "196", () => { 49 media.addEventListener("volumechange", () => { 50 shouldBe("media.volume", "1"); 51 debug(""); 52 media.remove(); 53 button.remove(); 54 finishJSTest(); 55 }); 56 57 debug(""); 58 debug("Pressing on the volume up button"); 59 pressOnElement(volumeUpButton); 60 }); 61 }); 55 62 }); 56 63 -
trunk/LayoutTests/platform/ios/TestExpectations
r228009 r228017 3291 3291 media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ] 3292 3292 media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Skip ] 3293 media/modern-media-controls/slider/slider-value.html [ Skip ] 3293 3294 3294 3295 webkit.org/b/178127 media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r228010 r228017 1496 1496 media/modern-media-controls/tracks-support [ Pass ] 1497 1497 media/modern-media-controls/tracks-button [ Pass ] 1498 media/modern-media-controls/volume-down-support [ Pass ] 1499 media/modern-media-controls/volume-support [ Pass ] 1498 1500 media/modern-media-controls/volume-up-support [ Pass ] 1499 1501
Note: See TracChangeset
for help on using the changeset viewer.