WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-137505-20141008112455.patch (text/plain), 13.87 KB, created by
Jer Noble
on 2014-10-08 11:24:53 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2014-10-08 11:24:53 PDT
Size:
13.87 KB
patch
obsolete
>Subversion Revision: 174461 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 383b6c644dce6f37042738ed4b07972531c7ac5b..31474b126501042bdc970a9a18ec92dfbaa1d07a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,33 @@ >+2014-10-08 Jer Noble <jer.noble@apple.com> >+ >+ Layout Test media/track/track-forced-subtitles-in-band.html is flaky >+ https://bugs.webkit.org/show_bug.cgi?id=137505 >+ >+ Reviewed by Simon Fraser. >+ >+ Now that the media controls can have audio as well as text tracks, use the aria-labelledby attribute >+ to get the <ul> containing the text track menu list items. >+ >+ * media/track/track-forced-subtitles-in-band.html: >+ * media/track/track-user-preferences-expected.txt: >+ * media/track/track-user-preferences.html: >+ * media/trackmenu-test.js: >+ (trackMenuListByLabel): >+ (captionTrackMenuList): >+ (audioTrackMenuList): >+ (indexOfMenuItemBeginningWith): >+ (indexOfCaptionMenuItemBeginningWith): >+ (indexOfAudioTrackMenuItemBeginningWith): >+ (selectMenuItemFromList): >+ (selectCaptionMenuItem): >+ (selectAudioTrackMenuItem): >+ (listTrackMenu): >+ (trackMenuList): Deleted. >+ * media/video-controls-audiotracks-trackmenu.html: >+ * media/video-controls-captions-trackmenu-includes-enabled-track.html: >+ * media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html: >+ * media/video-controls-captions-trackmenu.html: >+ > 2014-10-08 Andy Estes <aestes@apple.com> > > REGRESSION (r174403): media/track/track-forced-subtitles-in-band.html fails >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 6cffd168d05f78b5eb328210351a733c12486881..2d568518bb09329aef512eb5589c08a3ee0993e2 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -228,5 +228,3 @@ webkit.org/b/137167 js/kde/function_arguments.html [ Failure ] > > # Promises/A+ 2.3.3 has many tests and it sometimes exceeds the time limit. > webkit.org/b/136878 js/promises-tests/promises-tests-2-3-3.html [ Slow ] >- >-webkit.org/b/137525 media/track/track-forced-subtitles-in-band.html [ Failure ] >diff --git a/LayoutTests/media/track/track-forced-subtitles-in-band.html b/LayoutTests/media/track/track-forced-subtitles-in-band.html >index f98bfbe2a972f864941770444046d90703881483..393aade94433831a0a758d2d757f04894645cdbe 100644 >--- a/LayoutTests/media/track/track-forced-subtitles-in-band.html >+++ b/LayoutTests/media/track/track-forced-subtitles-in-band.html >@@ -28,7 +28,7 @@ > // Click the CC button to show the menu because it isn't created until it becomes visible. > clickCCButton(); > >- trackMenuItems = trackMenuList(); >+ trackMenuItems = captionTrackMenuList(); > if (!trackMenuItems) { > failTest("Failed to find track menu!"); > return; >diff --git a/LayoutTests/media/track/track-user-preferences-expected.txt b/LayoutTests/media/track/track-user-preferences-expected.txt >index 335f4513975937d1ce09f4e2e802b9ca6c5a0605..3a4e94baaace23961fe890333c61849dae58a7bb 100644 >--- a/LayoutTests/media/track/track-user-preferences-expected.txt >+++ b/LayoutTests/media/track/track-user-preferences-expected.txt >@@ -18,9 +18,9 @@ EXPECTED (event.target.readyState == '2') OK > > Test 3: select 'fr' track from menu > - show captions menu. >-EXPECTED (trackMenuItems[indexOfMenuItemBeginningWith('French')].className == '') OK >-EXPECTED (trackMenuItems[indexOfMenuItemBeginningWith('English')].className == '') OK >-EXPECTED (trackMenuItems[indexOfMenuItemBeginningWith('Norwegian')].className == 'selected') OK >+EXPECTED (trackMenuItems[indexOfCaptionMenuItemBeginningWith('French')].className == '') OK >+EXPECTED (trackMenuItems[indexOfCaptionMenuItemBeginningWith('English')].className == '') OK >+EXPECTED (trackMenuItems[indexOfCaptionMenuItemBeginningWith('Norwegian')].className == 'selected') OK > - click on 'French' menu item. > EVENT(load) > EXPECTED (event.target.srclang == 'fr') OK >diff --git a/LayoutTests/media/track/track-user-preferences.html b/LayoutTests/media/track/track-user-preferences.html >index 7a5c649898f60da49d698eeeea7f34aea3a90e29..c5875d8226748712b1d988a20c4e23828d494e28 100644 >--- a/LayoutTests/media/track/track-user-preferences.html >+++ b/LayoutTests/media/track/track-user-preferences.html >@@ -83,10 +83,10 @@ > break; > > case 4: >- trackMenuItems = trackMenuList(); >- testExpected("trackMenuItems[indexOfMenuItemBeginningWith('French')].className", ""); >- testExpected("trackMenuItems[indexOfMenuItemBeginningWith('English')].className", ""); >- testExpected("trackMenuItems[indexOfMenuItemBeginningWith('Norwegian')].className", "selected"); >+ trackMenuItems = captionTrackMenuList(); >+ testExpected("trackMenuItems[indexOfCaptionMenuItemBeginningWith('French')].className", ""); >+ testExpected("trackMenuItems[indexOfCaptionMenuItemBeginningWith('English')].className", ""); >+ testExpected("trackMenuItems[indexOfCaptionMenuItemBeginningWith('Norwegian')].className", "selected"); > > selectCaptionMenuItem("French"); > expectedLanguage = 'fr'; >diff --git a/LayoutTests/media/trackmenu-test.js b/LayoutTests/media/trackmenu-test.js >index e537d3866d9d0a58aa377521b847f93a1ae99deb..e6d5697446b60ab5280c3711455dd5b0a62c342f 100644 >--- a/LayoutTests/media/trackmenu-test.js >+++ b/LayoutTests/media/trackmenu-test.js >@@ -42,7 +42,7 @@ function getTrackListElement() > return trackListElement; > } > >-function trackMenuList() >+function trackMenuListByLabel(label) > { > trackListElement = getTrackListElement(); > if (!trackListElement){ >@@ -50,8 +50,13 @@ function trackMenuList() > return; > } > >+ var trackLists = trackListElement.querySelectorAll("ul"); >+ var trackList = Array.prototype.find.call(trackLists, function(item) { >+ return item.getAttribute('aria-labelledby') === label; >+ }); >+ >+ > // Track list should have a <ul> with <li> children. >- var trackList = trackListElement.querySelector("ul"); > if (!trackList) { > failTest("Could not find a child ul element in track list menu"); > return; >@@ -65,9 +70,18 @@ function trackMenuList() > return trackListItems; > } > >-function indexOfMenuItemBeginningWith(title) >+function captionTrackMenuList() >+{ >+ return trackMenuListByLabel('webkitMediaControlsClosedCaptionsHeading'); >+} >+ >+function audioTrackMenuList() >+{ >+ return trackMenuListByLabel('webkitMediaControlsAudioTrackHeading'); >+} >+ >+function indexOfMenuItemBeginningWith(title, trackMenuItems) > { >- var trackMenuItems = trackMenuList(); > for (i = 0; i < trackMenuItems.length; ++i) { > if (trackMenuItems[i].textContent.indexOf(title) == 0) > break; >@@ -75,15 +89,18 @@ function indexOfMenuItemBeginningWith(title) > return (i < trackMenuItems.length) ? i : -1; > } > >-function selectCaptionMenuItem(title) >+function indexOfCaptionMenuItemBeginningWith(title) > { >- var trackMenuItems = trackMenuList(); >- var index = indexOfMenuItemBeginningWith(title); >- if (index < 0) { >- failTest("Menu item " + title + " not found in track list menu."); >- return; >- } >+ return indexOfMenuItemBeginningWith(title, captionTrackMenuList()); >+} > >+function indexOfAudioTrackMenuItemBeginningWith(title) >+{ >+ return indexOfMenuItemBeginningWith(title, audioTrackMenuList()); >+} >+ >+function selectMenuItemFromList(title, trackMenuItems, index) >+{ > consoleWrite("- click on '" + title + "' menu item."); > var selectedTrackItem = trackMenuItems[index]; > var boundingRect = selectedTrackItem.getBoundingClientRect(); >@@ -94,6 +111,28 @@ function selectCaptionMenuItem(title) > eventSender.mouseUp(); > } > >+function selectCaptionMenuItem(title) >+{ >+ var index = indexOfCaptionMenuItemBeginningWith(title); >+ if (index < 0) { >+ failTest("Menu item " + title + " not found in track list menu."); >+ return; >+ } >+ >+ selectMenuItemFromList(title, captionTrackMenuList(), index); >+} >+ >+function selectAudioTrackMenuItem(title) >+{ >+ var index = indexOfAudioTrackMenuItemBeginningWith(title); >+ if (index < 0) { >+ failTest("Menu item " + title + " not found in track list menu."); >+ return; >+ } >+ >+ selectMenuItemFromList(title, audioTrackMenuList(), index); >+} >+ > function showTrackMenu() > { > clickCCButton(); >@@ -111,7 +150,7 @@ function hideTrackMenu() > > function listTrackMenu() > { >- var trackListItems = trackMenuList(); >+ var trackListItems = captionTrackMenuList(); > consoleWrite("Track menu:"); > for (i = 0; i < trackListItems.length; i++) { > var logString = i + ": \"" + trackListItems[i].textContent + "\""; >diff --git a/LayoutTests/media/video-controls-audiotracks-trackmenu.html b/LayoutTests/media/video-controls-audiotracks-trackmenu.html >index 7fd854269cbe523d001165ddeb01e6a3777fa86f..328762eeaaec7e0e71c378d31ab26a2a86872aeb 100644 >--- a/LayoutTests/media/video-controls-audiotracks-trackmenu.html >+++ b/LayoutTests/media/video-controls-audiotracks-trackmenu.html >@@ -25,7 +25,7 @@ > > function testMenu() > { >- trackListItems = trackMenuList(); >+ trackListItems = audioTrackMenuList(); > var expectedItemCount = video.audioTracks.length; > consoleWrite("There should be " + expectedItemCount + " items in the menu."); > testExpected("trackListItems.length", expectedItemCount); >@@ -33,7 +33,7 @@ > > function testAudioTrackEnabled() > { >- trackListItems = trackMenuList(); >+ trackListItems = audioTrackMenuList(); > consoleWrite("*** Menu item 0 should be selected"); > > testExpected("trackListItems.length", 3); >@@ -47,7 +47,7 @@ > function selectDifferentAudioTrack() > { > consoleWrite("*** Selecting French Track"); >- selectCaptionMenuItem("French"); >+ selectAudioTrackMenuItem("French"); > setTimeout(testAudioTrackDisabled, 100); > } > >diff --git a/LayoutTests/media/video-controls-captions-trackmenu-includes-enabled-track.html b/LayoutTests/media/video-controls-captions-trackmenu-includes-enabled-track.html >index d5774d0120b396d86711ee76b560b6cd13d00766..2554adf5cc2d873107b9b3334988c9c1c6757108 100644 >--- a/LayoutTests/media/video-controls-captions-trackmenu-includes-enabled-track.html >+++ b/LayoutTests/media/video-controls-captions-trackmenu-includes-enabled-track.html >@@ -15,7 +15,7 @@ > > function testInitialState() > { >- trackListItems = trackMenuList(); >+ trackListItems = captionTrackMenuList(); > consoleWrite("<br>*** Initially both tracks are disabled so neither should be selected."); > testExpected("video.textTracks[0].mode", "disabled"); > testExpected("video.textTracks[1].mode", "disabled"); >@@ -35,7 +35,7 @@ > function testMenuAfterEnablingTracks() > { > consoleWrite("<br>*** Both tracks are enabled so both should be selected."); >- trackListItems = trackMenuList(); >+ trackListItems = captionTrackMenuList(); > testExpected("video.textTracks[0].mode", "showing"); > testExpected("video.textTracks[1].mode", "showing"); > consoleWrite(""); >diff --git a/LayoutTests/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html b/LayoutTests/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html >index a390d4caf064168d835d43d8b0c4108206b283c8..00098397600909717465b74084b810dc3a681762 100644 >--- a/LayoutTests/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html >+++ b/LayoutTests/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html >@@ -13,7 +13,7 @@ > function testMenu() > { > showTrackMenu(); >- trackListItems = trackMenuList(); >+ trackListItems = captionTrackMenuList(); > var matchingTracks = 0; > for (var i = 0; i < video.textTracks.length; ++i) { > var kind = video.textTracks[i].kind; >diff --git a/LayoutTests/media/video-controls-captions-trackmenu.html b/LayoutTests/media/video-controls-captions-trackmenu.html >index fcac4f51cc634377f4f49eb8cbe0d19988005677..7c79410810afd7b2e0eb59b022f86c5412bd08e3 100644 >--- a/LayoutTests/media/video-controls-captions-trackmenu.html >+++ b/LayoutTests/media/video-controls-captions-trackmenu.html >@@ -24,7 +24,7 @@ > consoleWrite(""); > } > >- function trackMenuList() >+ function captionTrackMenuList() > { > var trackListElement = getTrackListElement(); > if (!trackListElement) >@@ -46,7 +46,7 @@ > > function testMenu() > { >- trackListItems = trackMenuList(); >+ trackListItems = captionTrackMenuList(); > var expectedItemCount = video.textTracks.length + 2; > consoleWrite("There should be " + expectedItemCount + " items in the menu."); > testExpected("trackListItems.length", expectedItemCount); >@@ -55,7 +55,7 @@ > function selectCaptionMenuItem(index, nextStep) > { > // Click on the selected item >- var trackListItems = trackMenuList(); >+ var trackListItems = captionTrackMenuList(); > var selectedTrackItem = trackListItems[index]; > var boundingRect = selectedTrackItem.getBoundingClientRect(); > var x = boundingRect.left + boundingRect.width / 2;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 137505
:
239439
|
239442
|
239443
| 239481