[GTK] improving tests expectations related to trackmenu

https://bugs.webkit.org/show_bug.cgi?id=120699

Adding tests expectations to the current GTK's trackmenu
implementation.

Also adding a in-band-track test expectation as failure since we don't
support in-band tracks yet.

Patch by Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk> on 2013-09-05
Reviewed by Gustavo Noronha Silva.

* platform/gtk/TestExpectations:
* platform/gtk/media/video-controls-captions-trackmenu-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-localized-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-sorted-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ccfa7d65
2013-09-05 Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
[GTK] improving tests expectations related to trackmenu
https://bugs.webkit.org/show_bug.cgi?id=120699
Adding tests expectations to the current GTK's trackmenu
implementation.
Also adding a in-band-track test expectation as failure since we don't
support in-band tracks yet.
Reviewed by Gustavo Noronha Silva.
* platform/gtk/TestExpectations:
* platform/gtk/media/video-controls-captions-trackmenu-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-localized-expected.txt: Added.
* platform/gtk/media/video-controls-captions-trackmenu-sorted-expected.txt: Added.
2013-09-05 Filip Pizlo <fpizlo@apple.com>
fast/js/dfg-* tests should wait for the concurrent JIT
......@@ -382,6 +382,7 @@ webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_ev
# No support for exposing in-band text tracks
webkit.org/b/103771 media/track/track-forced-subtitles-in-band.html [ Timeout Failure ]
webkit.org/b/103771 media/track/track-in-band-duplicate-tracks-when-source-changes.html [ Failure ]
webkit.org/b/103771 media/track/track-in-band.html [ Failure ]
webkit.org/b/103771 media/track/track-in-band-cues-added-once.html [ Timeout ]
webkit.org/b/103771 media/track/track-in-band-style.html [ Timeout ]
......
Test that we are able to trigger the list of captions, and select from the list.
EVENT(canplaythrough)
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
*** Add another text track.
RUN(video.addTextTrack("captions", "Commentary", "ru"))
*** Turning captions on
There should be 6 items in the menu.
EXPECTED (trackListItems.length == '6') OK
EXPECTED (video.textTracks.length == '4') OK
Track 0 should be showing
EXPECTED (video.textTracks[0].mode == 'showing') OK
Track 1 should be disabled
EXPECTED (video.textTracks[1].mode == 'disabled') OK
Track 2 should be disabled
EXPECTED (video.textTracks[2].mode == 'disabled') OK
Track 3 should be disabled
EXPECTED (video.textTracks[3].mode == 'disabled') OK
EXPECTED (textTrackDisplayElement(video, 'display').innerText == 'Lorem') OK
*** Remove a track.
RUN(video.removeChild(document.querySelectorAll("track")[0]))
*** Turning captions off
There should be 5 items in the menu.
EXPECTED (trackListItems.length == '5') OK
EXPECTED (video.textTracks.length == '3') OK
Track 0 should be disabled
EXPECTED (video.textTracks[0].mode == 'disabled') OK
Track 1 should be disabled
EXPECTED (video.textTracks[1].mode == 'disabled') OK
Track 2 should be disabled
EXPECTED (video.textTracks[2].mode == 'disabled') OK
No text track cue with display id '-webkit-media-text-track-display' is currently visible
END OF TEST
Test that we are able to trigger the list of captions, and then click elsewhere to hide it.
EVENT(canplaythrough)
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
*** Track menu should be visible block
EXPECTED (displayStyle == 'block') OK
*** Track menu should be invisible none
EXPECTED (displayStyle == 'none') OK
END OF TEST
Test that captions and subtitles menu items are localized.
EVENT(canplaythrough)
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
Heading should be labelled 'Subtitles'
EXPECTED (trackListSection.textContent == 'Subtitles') OK
First item in captions menu should be labelled 'Off'
EXPECTED (item.textContent == 'Off') OK
Second item in captions menu should be labelled 'Auto (Recommended)'
EXPECTED (item.textContent == 'Auto (Recommended)'), OBSERVED 'Auto' FAIL
Third item in captions menu should be labelled 'English CC'
EXPECTED (item.textContent == 'English CC'), OBSERVED 'Laugh Track' FAIL
Fourth item in captions menu should be labelled 'Laugh Track (English-United States)'
EXPECTED (item.textContent == 'Laugh Track (English-United States)'), OBSERVED 'No label' FAIL
Fifth item in captions menu should be labelled 'Unknown'
TypeError: undefined is not an object (evaluating 'item.textContent')
END OF TEST
Test that captions and subtitles are sorted in the menu according to user preferences.
EVENT(canplaythrough)
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
** Test with preferred language set to English, track type set to captions
RUN(internals.settings.setShouldDisplayTrackKind('Captions', true))
EXPECTED (trackMenuItems[0].textContent == 'Off') OK
EXPECTED (trackMenuItems[1].textContent == 'Auto (Recommended)'), OBSERVED 'Auto' FAIL
EXPECTED (trackMenuItems[2].textContent == 'u (English)'), OBSERVED 'u' FAIL
EXPECTED (trackMenuItems[3].textContent == 'y (English-Australia)'), OBSERVED 'v' FAIL
EXPECTED (trackMenuItems[4].textContent == 'v (English)'), OBSERVED 'w' FAIL
EXPECTED (trackMenuItems[5].textContent == 'x (English-Australia)'), OBSERVED 'x' FAIL
EXPECTED (trackMenuItems[6].textContent == 'w (Japanese)'), OBSERVED 'y' FAIL
EXPECTED (trackMenuItems[7].textContent == 'z (Japanese)'), OBSERVED 'z' FAIL
EXPECTED (video.textTracks.length == '6') OK
EXPECTED (trackMenuItems.length == '8') OK
** Change preferred language to Japanese, change preference to subtitles
RUN(internals.setUserPreferredLanguages(['ja']))
RUN(internals.settings.setShouldDisplayTrackKind('Captions', false))
RUN(internals.settings.setShouldDisplayTrackKind('Subtitles', true))
EXPECTED (trackMenuItems[0].textContent == 'Off') OK
EXPECTED (trackMenuItems[1].textContent == 'Auto (Recommended)'), OBSERVED 'Auto' FAIL
EXPECTED (trackMenuItems[2].textContent == 'z (Japanese)'), OBSERVED 'u' FAIL
EXPECTED (trackMenuItems[3].textContent == 'v (English)'), OBSERVED 'v' FAIL
EXPECTED (trackMenuItems[4].textContent == 'x (English-Australia)'), OBSERVED 'w' FAIL
EXPECTED (video.textTracks.length == '6') OK
EXPECTED (trackMenuItems.length == '5'), OBSERVED '8' FAIL
END OF TEST
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment