Changeset 247207 in webkit


Ignore:
Timestamp:
Jul 8, 2019 4:47:13 AM (5 years ago)
Author:
cturner@igalia.com
Message:

[GStreamer] media/video-volume.html broken after switching from cubic to linear scaling
https://bugs.webkit.org/show_bug.cgi?id=199505

Reviewed by Xabier Rodriguez-Calvar.

PulseAudio has a conversion process from volume's in
double-precision to uint32_t volumes. Depending on the environment
can introduce rounding errors. Be more lenient in our comparison
code.

  • media/video-volume-expected.txt: Update baseline
  • media/video-volume.html: Compare volume values within a

reasonable tolerance.

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247205 r247207  
     12019-07-08  Charlie Turner  <cturner@igalia.com>
     2
     3        [GStreamer] media/video-volume.html broken after switching from cubic to linear scaling
     4        https://bugs.webkit.org/show_bug.cgi?id=199505
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        PulseAudio has a conversion process from volume's in
     9        double-precision to uint32_t volumes. Depending on the environment
     10        can introduce rounding errors. Be more lenient in our comparison
     11        code.
     12
     13        * media/video-volume-expected.txt: Update baseline
     14        * media/video-volume.html: Compare volume values within a
     15        reasonable tolerance.
     16
    1172019-07-08  Antoine Quint  <graouts@apple.com>
    218
  • trunk/LayoutTests/media/video-volume-expected.txt

    r158743 r247207  
    22Test 'volume' attribute
    33
    4 EXPECTED (video.volume == '1') OK
     4EXPECTED (compareWithTolerance(video.volume, 1.0) == 'true') OK
    55RUN(video.volume = 0.5)
    6 EXPECTED (video.volume == '0.5') OK
     6EXPECTED (compareWithTolerance(video.volume, 0.5) == 'true') OK
    77RUN(video.volume = 0)
    8 EXPECTED (video.volume == '0') OK
     8EXPECTED (compareWithTolerance(video.volume, 0) == 'true') OK
    99TEST(video.volume = 1.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
    1010TEST(video.volume = -0.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
    1111RUN(video.load())
    1212EVENT(canplaythrough)
    13 EXPECTED (video.volume == '0') OK
     13EXPECTED (compareWithTolerance(video.volume, 0) == 'true') OK
    1414RUN(video.volume = 0.5)
    15 EXPECTED (video.volume == '0.5') OK
     15EXPECTED (compareWithTolerance(video.volume, 0.5) == 'true') OK
    1616TEST(video.volume = 1.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
    1717TEST(video.volume = -0.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
  • trunk/LayoutTests/media/video-volume.html

    r147969 r247207  
    44<script src=video-test.js></script>
    55<script>
    6     testExpected("video.volume", 1.0);
     6    function compareWithTolerance(a, b) {
     7        tolerance = 0.00001;
     8        return (Math.abs(a - b) < tolerance);
     9    }
     10    testExpected("compareWithTolerance(video.volume, 1.0)", true);
    711    run("video.volume = 0.5");
    8     testExpected("video.volume", 0.5);
     12    testExpected("compareWithTolerance(video.volume, 0.5)", true);
    913    run("video.volume = 0");
    10     testExpected("video.volume", 0);
     14    testExpected("compareWithTolerance(video.volume, 0)", true);
    1115    testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
    1216    testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
     
    1418    run("video.load()");
    1519    waitForEvent("canplaythrough", function () {
    16         testExpected("video.volume", 0);
     20        testExpected("compareWithTolerance(video.volume, 0)", true);
    1721        run("video.volume = 0.5");
    18         testExpected("video.volume", 0.5);
     22        testExpected("compareWithTolerance(video.volume, 0.5)", true);
    1923        testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
    2024        testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
Note: See TracChangeset for help on using the changeset viewer.