[Modern Media Controls] Fix media/modern-media-controls/status-label/status-label...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 18:38:51 +0000 (18:38 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 18:38:51 +0000 (18:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165259

Reviewed by Dean Jackson.

We broke the test at media/modern-media-controls/status-label/status-label.html with the
fix for https://bugs.webkit.org/show_bug.cgi?id=165239 since the test would test the
font-family for a StatusLabel which would only inherited to be -apple-system when hosted
in a MediaControls instance. We now remove this assertion and added a dedicated test
for when a StatusLabel is hosted in a MediaControls.

* media/modern-media-controls/status-label/status-label-expected.txt:
* media/modern-media-controls/status-label/status-label-font-expected.txt: Added.
* media/modern-media-controls/status-label/status-label-font.html: Added.
* media/modern-media-controls/status-label/status-label.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/status-label/status-label-expected.txt
LayoutTests/media/modern-media-controls/status-label/status-label-font-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/status-label/status-label-font.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/status-label/status-label.html

index ace6f2e..ef55558 100644 (file)
@@ -1,3 +1,21 @@
+2016-12-01  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Fix media/modern-media-controls/status-label/status-label.html
+        https://bugs.webkit.org/show_bug.cgi?id=165259
+
+        Reviewed by Dean Jackson.
+
+        We broke the test at media/modern-media-controls/status-label/status-label.html with the
+        fix for https://bugs.webkit.org/show_bug.cgi?id=165239 since the test would test the
+        font-family for a StatusLabel which would only inherited to be -apple-system when hosted
+        in a MediaControls instance. We now remove this assertion and added a dedicated test
+        for when a StatusLabel is hosted in a MediaControls.
+
+        * media/modern-media-controls/status-label/status-label-expected.txt:
+        * media/modern-media-controls/status-label/status-label-font-expected.txt: Added.
+        * media/modern-media-controls/status-label/status-label-font.html: Added.
+        * media/modern-media-controls/status-label/status-label.html:
+
 2016-12-01  Ryan Haddad  <ryanhaddad@apple.com>
 
         Marking media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html as failing on mac-wk1.
index 9791da1..afd7641 100644 (file)
@@ -18,7 +18,6 @@ PASS style.position is "absolute"
 PASS style.textOverflow is "ellipsis"
 PASS style.whiteSpace is "nowrap"
 PASS style.overflow is "hidden"
-PASS style.fontFamily is "-apple-system"
 PASS style.fontSize is "14px"
 PASS rgba(style.color).r is 255
 PASS rgba(style.color).g is 255
diff --git a/LayoutTests/media/modern-media-controls/status-label/status-label-font-expected.txt b/LayoutTests/media/modern-media-controls/status-label/status-label-font-expected.txt
new file mode 100644 (file)
index 0000000..cef34eb
--- /dev/null
@@ -0,0 +1,11 @@
+Testing the StatusLabel font is correctly set when hosted in media controls.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.getComputedStyle(mediaControls.statusLabel.element).fontFamily is "-apple-system"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/status-label/status-label-font.html b/LayoutTests/media/modern-media-controls/status-label/status-label-font.html
new file mode 100644 (file)
index 0000000..a904089
--- /dev/null
@@ -0,0 +1,25 @@
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
+<body>
+<script type="text/javascript">
+
+window.jsTestIsAsync = true;
+
+description("Testing the <code>StatusLabel</code> font is correctly set when hosted in media controls.");
+
+const mediaControls = new MacOSInlineMediaControls({ width: 600, height: 300 });
+mediaControls.showsStartButton = false;
+mediaControls.statusLabel.text = "Hello";
+document.body.appendChild(mediaControls.element);
+
+scheduler.frameDidFire = function()
+{
+    shouldBeEqualToString("window.getComputedStyle(mediaControls.statusLabel.element).fontFamily", "-apple-system");
+    mediaControls.element.remove();
+    debug("");
+    finishJSTest();
+};
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
index 7bc5a1a..97a3873 100644 (file)
@@ -39,7 +39,6 @@ scheduler.frameDidFire = function()
     shouldBeEqualToString("style.textOverflow", "ellipsis");
     shouldBeEqualToString("style.whiteSpace", "nowrap");
     shouldBeEqualToString("style.overflow", "hidden");
-    shouldBeEqualToString("style.fontFamily", "-apple-system");
     shouldBeEqualToString("style.fontSize", "14px");
     shouldBeEqualToRGBAColor("style.color", "rgba(255, 255, 255, 0.572)");