Title: [231357] trunk/LayoutTests
Revision
231357
Author
[email protected]
Date
2018-05-04 10:21:21 -0700 (Fri, 04 May 2018)

Log Message

Improve test at media/modern-media-controls/airplay-button/airplay-button-on.html to not hardcode the -apple-wireless-playback-target-active color
https://bugs.webkit.org/show_bug.cgi?id=185297
<rdar://problem/39737716>

Patch by Antoine Quint <[email protected]> on 2018-05-04
Reviewed by Dean Jackson.

Create an element and set its "color" property to "-apple-wireless-playback-target-active" so we can use
getComputedStyle() to query the applied value instead of hard-coding the expected color.

* media/modern-media-controls/airplay-button/airplay-button-on.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231356 => 231357)


--- trunk/LayoutTests/ChangeLog	2018-05-04 16:51:16 UTC (rev 231356)
+++ trunk/LayoutTests/ChangeLog	2018-05-04 17:21:21 UTC (rev 231357)
@@ -1,3 +1,16 @@
+2018-05-04  Antoine Quint  <[email protected]>
+
+        Improve test at media/modern-media-controls/airplay-button/airplay-button-on.html to not hardcode the -apple-wireless-playback-target-active color
+        https://bugs.webkit.org/show_bug.cgi?id=185297
+        <rdar://problem/39737716>
+
+        Reviewed by Dean Jackson.
+
+        Create an element and set its "color" property to "-apple-wireless-playback-target-active" so we can use
+        getComputedStyle() to query the applied value instead of hard-coding the expected color.
+
+        * media/modern-media-controls/airplay-button/airplay-button-on.html:
+
 2018-05-04  Youenn Fablet  <[email protected]>
 
         PeerConnection should have its connectionState closed even if doing gathering

Modified: trunk/LayoutTests/media/modern-media-controls/airplay-button/airplay-button-on.html (231356 => 231357)


--- trunk/LayoutTests/media/modern-media-controls/airplay-button/airplay-button-on.html	2018-05-04 16:51:16 UTC (rev 231356)
+++ trunk/LayoutTests/media/modern-media-controls/airplay-button/airplay-button-on.html	2018-05-04 17:21:21 UTC (rev 231357)
@@ -13,7 +13,11 @@
 
 document.body.appendChild(airplayButton.element);
 
-const airplayColor = window.navigator.platform === "MacIntel" ? "rgb(27, 173, 248)" : "rgb(0, 122, 255)";
+// Obtain the plaform-specific color by creating an element using -apple-wireless-playback-target-active.
+const airplayColorButton = document.body.appendChild(document.createElement("div"));
+airplayColorButton.style.color = "-apple-wireless-playback-target-active";
+const airplayColor = getComputedStyle(airplayColorButton).color;
+airplayColorButton.remove();
 
 shouldBecomeEqual('airplayButton.element.classList.contains("on")', "true", () => {
     shouldBecomeEqualToString("window.getComputedStyle(airplayButton.element).backgroundColor", "rgba(0, 0, 0, 0)", () => {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to