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

Changeset 203526 in webkit


Ignore:
Timestamp:
Jul 21, 2016, 2:19:22 PM (10 years ago)
Author:
dbates@webkit.org
Message:

Test platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html is flaky
​https://bugs.webkit.org/show_bug.cgi?id=160002

Reviewed by Alexey Proskuryakov.

The file platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html tests loading
plugin content from the main frame and from a subframe. Depending on timing the plugin
content loaded in the subframe may complete before plugin content loaded in the main frame.
We should test loading plugin content in a subframe after perform all main frame sub-tests
so as to ensure a well-defined sub-test order.

Add logic to ensure that an embedded YouTube flash video loaded in a subframe actually creates
a shadow DOM. Additionally, simplify the test logic by making use window.jsTestIsAsync/finishJSTest()
to mark the test as asynchronous and notify test completion instead of calling
window.testRunner.{waitUntilDone, notifyDone}(), remove the call to
testRunner.dumpAsText() (js-test-pre.js calls this for us), remove all of the DOM elements
used in the test to avoid noise in the expected results, and fix some style nits.

  • platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt:
  • platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203525 r203526  
     12016-07-21  Daniel Bates  <dabates@apple.com>
     2
     3        Test platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=160002
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        The file platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html tests loading
     9        plugin content from the main frame and from a subframe. Depending on timing the plugin
     10        content loaded in the subframe may complete before plugin content loaded in the main frame.
     11        We should test loading plugin content in a subframe after perform all main frame sub-tests
     12        so as to ensure a well-defined sub-test order.
     13
     14        Add logic to ensure that an embedded YouTube flash video loaded in a subframe actually creates
     15        a shadow DOM. Additionally, simplify the test logic by making use window.jsTestIsAsync/finishJSTest()
     16        to mark the test as asynchronous and notify test completion instead of calling
     17        window.testRunner.{waitUntilDone, notifyDone}(), remove the call to
     18        testRunner.dumpAsText() (js-test-pre.js calls this for us), remove all of the DOM elements
     19        used in the test to avoid noise in the expected results, and fix some style nits.
     20
     21        * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt:
     22        * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html:
     23
    1242016-07-21  Chris Dumez  <cdumez@apple.com>
    225
  • trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt

    r203522 r203526  
    99
    1010
    11 PASS successfullyParsed is true
    12 
    13 TEST COMPLETE
    1411PASS normalEmbed.tagName is "EMBED"
    1512PASS elinkEmbed.tagName is "EMBED"
    … …  
    2320PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement"
    2421PASS objectNoEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
    25 Normal Embed:
     22PASS internals.shadowPseudoId(normalEmbedInIframeShadowRoot.firstChild) is "-webkit-plugin-replacement"
     23PASS normalEmbedInIframeShadowRoot.firstChild.firstChild.tagName is "IFRAME"
     24PASS successfullyParsed is true
    2625
    27 E-link Embed:
     26TEST COMPLETE
    2827
    29 Object with embed:
    30 
    31 Object without embed:
    32 
    33 Embed inside iframe:
    34 
  • trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html

    r203522 r203526  
    44<script src="../../../../resources/js-test-pre.js"></script>
    55<script>
    6 if (window.testRunner) {
    7     testRunner.waitUntilDone();
    8     testRunner.dumpAsText();
    9 }
     6window.jsTestIsAsync = true;
    107
    118description(
    129    'Test transforming youtube flash plugin to youtube iFrame based player. &lt;<a href="rdar://problem/11201356"> rdar://problem/11201356</a>&gt;'
    1310);
     11
     12function checkEmbeddedYouTubeVideoInsideIframe()
     13{
     14    normalEmbedInIframe = document.getElementById('test-iframe').contentDocument.getElementById('normal-embed');
     15    normalEmbedInIframeShadowRoot = internals.shadowRoot(normalEmbedInIframe);
     16    shouldBe('internals.shadowPseudoId(normalEmbedInIframeShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
     17    shouldBe('normalEmbedInIframeShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
     18
     19    document.body.removeChild(document.getElementById("test-container"));
     20    finishJSTest();
     21}
     22
     23function testEmbedYouTubeVideoInsideIframe()
     24{
     25    var markup = [
     26        '<body>',
     27        '<p>Normal Embed:<br><embed id="normal-embed" src="http://www.youtube.com/v/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p>',
     28        '<script>',
     29        'window.setTimeout(window.parent.checkEmbeddedYouTubeVideoInsideIframe, 0);',
     30        '</' + 'script>',
     31        '</body>',
     32    ];
     33    var iframe = document.getElementById('test-iframe');
     34    iframe.srcdoc = markup.join("");
     35}
    1436
    1537function Test()
    … …  
    4365        shouldBe('objectNoEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
    4466
    45         var successfullyParsed = true;
    46         testRunner.notifyDone();
    47     }, 100);
     67        testEmbedYouTubeVideoInsideIframe();
     68    }, 0);
    4869}
    4970</script>
    … …  
    5374<div id="console"></div>
    5475
    55 <p>Normal Embed:<br><embed id='normal-embed' src="http://www.youtube.com/v/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p>
    56 <p>E-link Embed:<br><embed id='elink-embed' src="http://www.youtube.com/e/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p>
    57 <p>Object with embed:<br><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed id='object-embed' src="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="425" height="350" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
    58 <p>Object without embed:<br><object id='object-no-embed' width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US"></object>
    59 <p>Embed inside iframe:<br>
    60 <iframe width="300" height="200"id='container-iframe'  src='data:text/html,<body><p>Normal Embed:<br><embed id="normal-embed" src="http://www.youtube.com/v/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p></body>' >
    61 </iframe>
     76<div id="test-container">
     77    <p>Normal Embed:<br><embed id="normal-embed" src="http://www.youtube.com/v/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p>
     78    <p>E-link Embed:<br><embed id="elink-embed" src="http://www.youtube.com/e/N0gb9v4LI4o" type="application/x-shockwave-flash" width="425" height="350"></p>
     79    <p>Object with embed:<br>
     80        <object width="425" height="350">
     81            <param name="movie" value="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US"></param>
     82            <param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
     83            <embed id="object-embed" src="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="425" height="350" allowscriptaccess="always" allowfullscreen="true"></embed>
     84        </object>
     85    </p>
     86    <p>Object without embed:<br><object id="object-no-embed" width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/N0gb9v4LI4o?version=3&amp;hl=en_US"></object>
     87    <p>Embed inside iframe:<br>
     88    <iframe width="300" height="200" id="test-iframe"></iframe>
     89</div>
    6290
    6391<script src="../../../../resources/js-test-post.js"></script>
Note: See TracChangeset for help on using the changeset viewer.