Diff
Modified: trunk/LayoutTests/ChangeLog (204600 => 204601)
--- trunk/LayoutTests/ChangeLog 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/ChangeLog 2016-08-18 18:05:56 UTC (rev 204601)
@@ -1,3 +1,26 @@
+2016-08-18 Eric Carlson <[email protected]>
+
+ AX: Audio Description tracks are not labeled correctly, causing user confusion
+ https://bugs.webkit.org/show_bug.cgi?id=160652
+ <rdar://problem/27742208>
+
+ Reviewed by Antoine Quint.
+
+ * http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Added.
+ * http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Added.
+
+ * media/trackmenu-test.js:
+ (clickCCButton): Fail immediately if "video" is null or not a media element. Make failure
+ logging more descriptive.
+
+ * platform/gtk/TestExpectations: Skip new test.
+
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt: Updated for
+ clickCCButton error message change.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Ditto.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.
+
2016-08-18 Ryan Haddad <[email protected]>
Rebaseline js/dom/global-constructors-attributes.html after r204594.
Added: trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt (0 => 204601)
--- trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt 2016-08-18 18:05:56 UTC (rev 204601)
@@ -0,0 +1,27 @@
+This tests the track menu when a file has a descriptive audio track.
+
+This test only runs in DRT!
+
+
+EVENT: error
+PASS: We are using the apple idiom
+
+EVENT: canplaythrough
+
+Test when track menu is hidden
+
+PASS: Menu name is 'Track Menu'
+PASS: Menu does not exist
+
+Test with visible menu
+
+PASS: Menu name is 'Track Menu'
+PASS: Menu exists
+PASS: id is 'audioAndTextTrackMenu'
+PASS: Menu element contains <ul>
+PASS: DVS audio menu item name contains track name from manifest
+PASS: DVS menu item name has been augmented
+PASS: Standard audio menu item name is the track name from manifest
+
+Testing finished.
+
Added: trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu.html (0 => 204601)
--- trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu.html (rev 0)
+++ trunk/LayoutTests/http/tests/media/hls/hls-accessiblity-describes-video-menu.html 2016-08-18 18:05:56 UTC (rev 204601)
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script>
+
+ const tester = new ControlsTest("non-existent-media-file", "error")
+ .whenReady(setup)
+ .start();
+ let retryCount = 0;
+ const maximumRetries = 10;
+
+ function setup()
+ {
+ findMediaElement();
+
+ var currentState = tester.currentState;
+ tester.test("We are using the apple idiom")
+ .value(currentState.idiom)
+ .isEqualTo("apple");
+
+ tester.resetEventTrigger("canplaythrough")
+ .whenReady(runTestsWithHiddenMenu)
+ .media.src = ""
+ tester.logBlankLine();
+ }
+
+ function runTestsWithHiddenMenu()
+ {
+ tester.startNewSection("Test when track menu is hidden");
+ const statusState = tester.stateForControlsElement("Track Menu");
+
+ tester.test("Menu name is 'Track Menu'")
+ .value(statusState.name)
+ .isEqualTo("Track Menu");
+
+ tester.test("Menu does not exist")
+ .value(statusState.element)
+ .isEqualTo(null);
+
+ // Show the track menu.
+ internals.suspendAnimations();
+ hideTrackMenu();
+ showTrackMenu();
+ requestAnimationFrame(runTestsWithVisibleMenu);
+ }
+
+ function runTestsWithVisibleMenu()
+ {
+ const menu = getTrackListElement();
+ if (menu === null || menu.firstChild === null) {
+ if (++retryCount > maximumRetries) {
+ tester.logFailure(`Track menu has not been configured after ${retryCount} retries`);
+ tester.end();
+ return;
+ }
+
+ requestAnimationFrame(runTestsWithVisibleMenu);
+ }
+
+ tester.startNewSection("Test with visible menu");
+ const statusState = tester.stateForControlsElement("Track Menu", true);
+
+ tester.test("Menu name is 'Track Menu'")
+ .value(statusState.name)
+ .isEqualTo("Track Menu");
+
+ tester.test("Menu exists")
+ .value(menu)
+ .isNotEqualTo(null);
+
+ tester.test("id is 'audioAndTextTrackMenu'")
+ .value(menu.id)
+ .isEqualTo("audioAndTextTrackMenu");
+
+ const menuList = menu.firstChild.children[1];
+ tester.test("Menu element contains <ul>")
+ .value(menuList.tagName)
+ .isEqualTo("UL");
+
+ const menuItem1 = menuList.children[0];
+ tester.test("DVS audio menu item name contains track name from manifest")
+ .value(menuItem1.textContent)
+ .contains("English DVS");
+
+ tester.test("DVS menu item name has been augmented")
+ .value(menuItem1.textContent)
+ .isNotEqualTo("English DVS");
+
+ const menuItem2 = menuList.children[1];
+ tester.test("Standard audio menu item name is the track name from manifest")
+ .value(menuItem2.textContent)
+ .isEqualTo("English Sound");
+
+ tester.end();
+ }
+
+ </script>
+ </head>
+ <body>
+ <p>This tests the track menu when a file has a descriptive audio track.</p>
+ <p>This test only runs in DRT!</p>
+ <video width="500" height="300" controls> </video>
+ </body>
+</html>
Modified: trunk/LayoutTests/media/trackmenu-test.js (204600 => 204601)
--- trunk/LayoutTests/media/trackmenu-test.js 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/media/trackmenu-test.js 2016-08-18 18:05:56 UTC (rev 204601)
@@ -2,11 +2,16 @@
function clickCCButton()
{
+ if (!video || (video.nodeName != "VIDEO" && video.nodeName != "AUDIO")) {
+ consoleWrite(`<br>*** ERROR: 'video' global = "${video} in clickCCButton`);
+ endTest();
+ }
+
if (!captionsButtonCoordinates) {
try {
captionsButtonCoordinates = mediaControlsButtonCoordinates(video, "toggle-closed-captions-button");
} catch (exception) {
- failTest(exception.description);
+ failTest(`clickCCButton failed with exception: "${exception.description}:`);
return;
}
}
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (204600 => 204601)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2016-08-18 18:05:56 UTC (rev 204601)
@@ -668,7 +668,6 @@
webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-video-resize.html [ Timeout Failure ]
webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-audio-tracks.html [ Timeout Failure ]
webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-audio-tracks-has-audio.html [ Timeout Failure ]
-webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-accessiblity-describes-video.html [ Timeout Failure ]
webkit.org/b/154390 [ Release ] http/tests/media/hls/video-cookie.html [ Failure ]
webkit.org/b/154390 http/tests/security/local-video-source-from-remote.html [ Timeout Pass ]
@@ -727,6 +726,10 @@
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html [ Skip ]
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html [ Skip ]
+# No support for descriptive audio tracks in HLS file
+http/tests/media/hls/hls-accessiblity-describes-video-menu.html [ Skip ]
+http/tests/media/hls/hls-accessiblity-describes-video.html [ Skip ]
+
#////////////////////////////////////////////////////////////////////////////////////////
# End of Expected failures
#////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt (204600 => 204601)
--- trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt 2016-08-18 18:05:56 UTC (rev 204601)
@@ -5,6 +5,6 @@
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
-undefined FAIL
+clickCCButton failed with exception: "undefined: FAIL
END OF TEST
Modified: trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt (204600 => 204601)
--- trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt 2016-08-18 18:05:56 UTC (rev 204601)
@@ -5,6 +5,6 @@
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
-undefined FAIL
+clickCCButton failed with exception: "undefined: FAIL
END OF TEST
Modified: trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt (204600 => 204601)
--- trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt 2016-08-18 18:05:56 UTC (rev 204601)
@@ -5,6 +5,6 @@
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
-undefined FAIL
+clickCCButton failed with exception: "undefined: FAIL
END OF TEST
Modified: trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt (204600 => 204601)
--- trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/LayoutTests/platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt 2016-08-18 18:05:56 UTC (rev 204601)
@@ -5,6 +5,6 @@
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
-undefined FAIL
+clickCCButton failed with exception: "undefined: FAIL
END OF TEST
Modified: trunk/Source/WebCore/ChangeLog (204600 => 204601)
--- trunk/Source/WebCore/ChangeLog 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/ChangeLog 2016-08-18 18:05:56 UTC (rev 204601)
@@ -1,3 +1,26 @@
+2016-08-18 Eric Carlson <[email protected]>
+
+ AX: Audio Description tracks are not labeled correctly, causing user confusion
+ https://bugs.webkit.org/show_bug.cgi?id=160652
+ <rdar://problem/27742208>
+
+ Reviewed by Antoine Quint.
+
+ * http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Added.
+ * http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Added.
+
+ * media/trackmenu-test.js:
+ (clickCCButton): Fail immediately if "video" is null or not a media element. Make failure
+ logging more descriptive.
+
+ * platform/gtk/TestExpectations: Skip new test.
+
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt: Updated for
+ clickCCButton error message change.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Ditto.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
+ * platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.
+
2016-08-18 Alex Christensen <[email protected]>
Fix WinCairo build after r204592.
Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (204600 => 204601)
--- trunk/Source/WebCore/English.lproj/Localizable.strings 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings 2016-08-18 18:05:56 UTC (rev 204601)
@@ -34,6 +34,9 @@
/* Text track contains closed captions */
"%@ CC" = "%@ CC";
+/* Text track contains Audio Descriptions */
+"%@ AD" = "%@ AD";
+
/* visible name of the database process. The argument is the application name. */
"%@ Database Storage" = "%@ Database Storage";
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (204600 => 204601)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2016-08-18 18:05:56 UTC (rev 204601)
@@ -653,8 +653,11 @@
if (displayName.isEmpty())
displayName.append(audioTrackNoLabelText());
-
- return displayName.toString();
+
+ if (track->kind() != AudioTrack::descriptionKeyword())
+ return displayName.toString();
+
+ return audioDescriptionTrackSuffixText(displayName.toString());
}
String CaptionUserPreferencesMediaAF::displayNameForTrack(AudioTrack* track) const
Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (204600 => 204601)
--- trunk/Source/WebCore/platform/LocalizedStrings.cpp 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp 2016-08-18 18:05:56 UTC (rev 204601)
@@ -1145,6 +1145,11 @@
{
return formatLocalizedString(WEB_UI_STRING("%@ Forced", "Text track contains forced subtitles"), title.createCFString().get());
}
+
+String audioDescriptionTrackSuffixText(const String& title)
+{
+ return formatLocalizedString(WEB_UI_STRING("%@ AD", "Text track contains Audio Descriptions"), title.createCFString().get());
+}
#endif
#endif
Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (204600 => 204601)
--- trunk/Source/WebCore/platform/LocalizedStrings.h 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h 2016-08-18 18:05:56 UTC (rev 204601)
@@ -266,6 +266,7 @@
String sdhTrackMenuItemText(const String&);
String easyReaderTrackMenuItemText(const String&);
String forcedTrackMenuItemText(const String&);
+ String audioDescriptionTrackSuffixText(const String&);
#endif
#endif
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm (204600 => 204601)
--- trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm 2016-08-18 17:54:27 UTC (rev 204600)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm 2016-08-18 18:05:56 UTC (rev 204601)
@@ -114,6 +114,8 @@
if (m_assetTrack) {
if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
return AudioTrackPrivate::Alternative;
+ if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
+ return AudioTrackPrivate::Description;
if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
return AudioTrackPrivate::Main;
return AudioTrackPrivate::None;
@@ -123,6 +125,8 @@
AVMediaSelectionOption *option = m_mediaSelectionOption->avMediaSelectionOption();
if ([option hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
return AudioTrackPrivate::Alternative;
+ if ([option hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
+ return AudioTrackPrivate::Description;
if ([option hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
return AudioTrackPrivate::Main;
return AudioTrackPrivate::None;