https://github.com/web-platform-tests/wpt
Revision b7b803ba171367071f288c5ab8a3fa09c62339bd authored by Hiroshige Hayashizaki on 25 December 2018, 02:04:03 UTC, committed by Chromium WPT Sync on 25 December 2018, 02:04:03 UTC
Manual changes: spec.src.json. All others are generated.

This caused two test files with the same contents with names
- same-origin-downgrade.http.html
- same-origin-upgrade.http.html
in directories under origin-when-cross-origin/.
This CL thus removes same-origin-downgrade.http.html without
affecting test coverage.

(same-origin-downgrade is currently supressed by
source-https-unsupported-by-web-platform-tests-runners and thus
this CL doesn't add new files)

Bug: 906850
Change-Id: I1fcc150c4b2b643b3186cbef9432d343f8b4a1dd
1 parent a357943
Raw File
Tip revision: b7b803ba171367071f288c5ab8a3fa09c62339bd authored by Hiroshige Hayashizaki on 25 December 2018, 02:04:03 UTC
[wpt/referrer-policy] Fix same-origin-downgrade in spec.src.json
Tip revision: b7b803b
MediaStream-MediaElement-preload-none-manual.https.html
<!DOCTYPE html>
<html>
    <head>
        <title>Test that the HTMLMediaElement preload 'none' attribute value is ignored for MediaStream used as srcObject and MediaStream object URLs used as src.</title>
        <link rel="author" title="Matthew Wolenetz" href="mailto:wolenetz@chromium.org"/>
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>
    </head>
    <body>
        <p class="instructions">When prompted, accept to share your audio and video streams.</p>
        <p class="instructions">This test checks that the HTMLMediaElement preload 'none' attribute value is ignored for MediaStream used as srcObject and MediaStream object URLs used as src.</p>
        <div id=log></div>

        <audio preload="none"></audio>
        <video preload="none"></video>

        <script>
            function testPreloadNone(t, mediaElement, setSourceStreamFunc)
            {
                // The optional deferred load steps (for preload none) for MediaStream resources should be skipped.
                mediaElement.addEventListener("suspend", t.unreached_func("'suspend' should not be fired."));
                mediaElement.addEventListener("error", t.step_func(function() {
                  assert_unreached("'error' should not be fired, code=" + mediaElement.error.code);
                }));

                mediaElement.addEventListener("loadeddata", t.step_func(function()
                {
                    assert_equals(mediaElement.networkState, mediaElement.NETWORK_LOADING);
                    t.done();
                }));

                setSourceStreamFunc();
                assert_equals(mediaElement.networkState, mediaElement.NETWORK_NO_SOURCE); // Resource selection is active.
            }

            async_test(function(t)
            {
                var aud = document.querySelector("audio");
                navigator.mediaDevices.getUserMedia({audio:true})
                  .then(t.step_func(function(stream)
                  {
                      testPreloadNone(t, aud, t.step_func(function() { aud.srcObject = stream; }));
                  }),
                  t.unreached_func("getUserMedia error callback was invoked."));
            }, "Test that preload 'none' is ignored for MediaStream object URL used as srcObject for audio");

            async_test(function(t)
            {
                var vid = document.querySelector("video");
                navigator.mediaDevices.getUserMedia({video:true})
                  .then(t.step_func(function(stream)
                  {
                      testPreloadNone(t, vid, t.step_func(function() { vid.srcObject = stream; }));
                  }), t.unreached_func("getUserMedia error callback was invoked."));
            }, "Test that preload 'none' is ignored for MediaStream used as srcObject for video");
        </script>
    </body>
</html>
back to top