⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278678 in webkit


Ignore:
Timestamp:
Jun 9, 2021, 3:42:51 PM (5 years ago)
Author:
Devin Rousso
Message:

(r278618) media/modern-media-controls/overflow-support/chapters.html is timing out since introduction
https://bugs.webkit.org/show_bug.cgi?id=226828
<rdar://problem/79084756>

Unreviewed text fix.

  • media/modern-media-controls/overflow-support/chapters.html:
  • media/modern-media-controls/overflow-support/chapters-expected.txt:

Wait for the <track kind="chapters"> to load before clicking on the overflow button as
otherwise there won't be any chapter cues to display in the contextmenu, meaning that the
contextmenu would be empty and therefore not be shown.

  • http/tests/resources/js-test-pre.js:

(shouldBecomeEqual):
(shouldBecomeDifferent):

  • resources/js-test-pre.js:

(shouldBecomeEqual):
(shouldBecomeDifferent):

  • resources/js-test.js:

(shouldBecomeEqual):
(shouldBecomeDifferent):
Allow for completionHandler to not be provided, which will cause the function to return a Promise.

Location:
trunk/LayoutTests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278676 r278678  
     12021-06-09  Devin Rousso  <drousso@apple.com>
     2
     3        (r278618) media/modern-media-controls/overflow-support/chapters.html is timing out since introduction
     4        https://bugs.webkit.org/show_bug.cgi?id=226828
     5        <rdar://problem/79084756>
     6
     7        Unreviewed text fix.
     8
     9        * media/modern-media-controls/overflow-support/chapters.html:
     10        * media/modern-media-controls/overflow-support/chapters-expected.txt:
     11        Wait for the `<track kind="chapters">` to load before clicking on the overflow button as
     12        otherwise there won't be any chapter cues to display in the contextmenu, meaning that the
     13        contextmenu would be empty and therefore not be shown.
     14
     15        * http/tests/resources/js-test-pre.js:
     16        (shouldBecomeEqual):
     17        (shouldBecomeDifferent):
     18        * resources/js-test-pre.js:
     19        (shouldBecomeEqual):
     20        (shouldBecomeDifferent):
     21        * resources/js-test.js:
     22        (shouldBecomeEqual):
     23        (shouldBecomeDifferent):
     24        Allow for `completionHandler` to not be provided, which will cause the function to return a `Promise`.
     25
    1262021-06-09  Amir Mark Jr  <amir_mark@apple.com>
    227
  • trunk/LayoutTests/http/tests/resources/js-test-pre.js

    r264304 r278678  
    327327        return false;
    328328    }
     329
     330    if (!completionHandler)
     331        return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     332
    329333    setTimeout(_waitForCondition, 0, condition, completionHandler);
    330334}
     
    439443        return false;
    440444    }
     445
     446    if (!completionHandler)
     447        return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     448
    441449    setTimeout(_waitForCondition, 0, condition, completionHandler);
    442450}
  • trunk/LayoutTests/media/modern-media-controls/overflow-support/chapters-expected.txt

    r278618 r278678  
    66PASS shadowRoot.querySelector('button.overflow') became different from null
    77PASS shadowRoot.querySelector('button.overflow').getBoundingClientRect().width became different from 0
     8PASS media.textTracks[0].mode became different from 'disabled'
    89Tapping overflow button...
    910Selecting first chapter cue...
  • trunk/LayoutTests/media/modern-media-controls/overflow-support/chapters.html

    r278618 r278678  
    2121let contextmenu = null;
    2222
    23 media.addEventListener("play", function() {
     23media.addEventListener("play", async function() {
    2424    media.pause();
    2525
    26     shouldBecomeDifferent("shadowRoot.querySelector('button.overflow')", "null", () => {
    27         shouldBecomeDifferent("shadowRoot.querySelector('button.overflow').getBoundingClientRect().width", "0", async () => {
    28             debug("Tapping overflow button...");
    29             await pressOnElement(shadowRoot.querySelector("button.overflow"));
    30             contextmenu = await getTracksContextMenu();
     26    await shouldBecomeDifferent("shadowRoot.querySelector('button.overflow')", "null");
    3127
    32             debug("Selecting first chapter cue...");
    33             await UIHelper.chooseMenuAction("ipsum");
    34             await UIHelper.waitForContextMenuToHide();
     28    await shouldBecomeDifferent("shadowRoot.querySelector('button.overflow').getBoundingClientRect().width", "0");
    3529
    36             shouldBeGreaterThanOrEqual("media.currentTime", "5");
     30    await shouldBecomeDifferent("media.textTracks[0].mode", "'disabled'");
    3731
    38             media.remove();
    39             finishJSTest();
    40         });
    41     });
     32    debug("Tapping overflow button...");
     33    await pressOnElement(shadowRoot.querySelector("button.overflow"));
     34    contextmenu = await getTracksContextMenu();
     35
     36    debug("Selecting first chapter cue...");
     37    await UIHelper.chooseMenuAction("ipsum");
     38    await UIHelper.waitForContextMenuToHide();
     39
     40    shouldBeGreaterThanOrEqual("media.currentTime", "5");
     41
     42    media.remove();
     43    finishJSTest();
    4244});
    4345
  • trunk/LayoutTests/resources/js-test-pre.js

    r264304 r278678  
    327327        return false;
    328328    }
     329
     330    if (!completionHandler)
     331        return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     332
    329333    setTimeout(_waitForCondition, 0, condition, completionHandler);
    330334}
     
    439443        return false;
    440444    }
     445
     446    if (!completionHandler)
     447        return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     448
    441449    setTimeout(_waitForCondition, 0, condition, completionHandler);
    442450}
  • trunk/LayoutTests/resources/js-test.js

    r277158 r278678  
    351351    return false;
    352352  }
     353
     354  if (!completionHandler)
     355    return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     356
    353357  setTimeout(_waitForCondition, 0, condition, completionHandler);
    354358}
     
    463467    return false;
    464468  }
     469
     470  if (!completionHandler)
     471    return new Promise(resolve => setTimeout(_waitForCondition, 0, condition, resolve));
     472
    465473  setTimeout(_waitForCondition, 0, condition, completionHandler);
    466474}
Note: See TracChangeset for help on using the changeset viewer.