Title: [203526] trunk/LayoutTests
Revision
203526
Author
[email protected]
Date
2016-07-21 14:19:22 -0700 (Thu, 21 Jul 2016)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203525 => 203526)


--- trunk/LayoutTests/ChangeLog	2016-07-21 21:11:06 UTC (rev 203525)
+++ trunk/LayoutTests/ChangeLog	2016-07-21 21:19:22 UTC (rev 203526)
@@ -1,3 +1,26 @@
+2016-07-21  Daniel Bates  <[email protected]>
+
+        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:
+
 2016-07-21  Chris Dumez  <[email protected]>
 
         Fix null handling for several HTMLBodyElement attributes

Modified: trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt (203525 => 203526)


--- trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt	2016-07-21 21:11:06 UTC (rev 203525)
+++ trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt	2016-07-21 21:19:22 UTC (rev 203526)
@@ -8,9 +8,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS successfullyParsed is true
-
-TEST COMPLETE
 PASS normalEmbed.tagName is "EMBED"
 PASS elinkEmbed.tagName is "EMBED"
 PASS objectEmbed.tagName is "EMBED"
@@ -22,13 +19,9 @@
 PASS objectEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
 PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement"
 PASS objectNoEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
-Normal Embed:
+PASS internals.shadowPseudoId(normalEmbedInIframeShadowRoot.firstChild) is "-webkit-plugin-replacement"
+PASS normalEmbedInIframeShadowRoot.firstChild.firstChild.tagName is "IFRAME"
+PASS successfullyParsed is true
 
-E-link Embed:
+TEST COMPLETE
 
-Object with embed:
-
-Object without embed:
-
-Embed inside iframe:
-

Modified: trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html (203525 => 203526)


--- trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html	2016-07-21 21:11:06 UTC (rev 203525)
+++ trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html	2016-07-21 21:19:22 UTC (rev 203526)
@@ -3,15 +3,37 @@
 <head>
 <script src=""
 <script>
-if (window.testRunner) {
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
-}
+window.jsTestIsAsync = true;
 
 description(
     'Test transforming youtube flash plugin to youtube iFrame based player. &lt;<a href="" rdar://problem/11201356</a>&gt;'
 );
 
+function checkEmbeddedYouTubeVideoInsideIframe()
+{
+    normalEmbedInIframe = document.getElementById('test-iframe').contentDocument.getElementById('normal-embed');
+    normalEmbedInIframeShadowRoot = internals.shadowRoot(normalEmbedInIframe);
+    shouldBe('internals.shadowPseudoId(normalEmbedInIframeShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
+    shouldBe('normalEmbedInIframeShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
+
+    document.body.removeChild(document.getElementById("test-container"));
+    finishJSTest();
+}
+
+function testEmbedYouTubeVideoInsideIframe()
+{
+    var markup = [
+        '<body>',
+        '<p>Normal Embed:<br><embed id="normal-embed" src="" type="application/x-shockwave-flash" width="425" height="350"></p>',
+        '<script>',
+        'window.setTimeout(window.parent.checkEmbeddedYouTubeVideoInsideIframe, 0);',
+        '</' + 'script>',
+        '</body>',
+    ];
+    var iframe = document.getElementById('test-iframe');
+    iframe.srcdoc = markup.join("");
+}
+
 function Test()
 {
     setTimeout(function() {
@@ -42,9 +64,8 @@
         shouldBe('internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
         shouldBe('objectNoEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
 
-        var successfullyParsed = true;
-        testRunner.notifyDone();
-    }, 100);
+        testEmbedYouTubeVideoInsideIframe();
+    }, 0);
 }
 </script>
 </head>
@@ -52,13 +73,20 @@
 <p id="description"></p>
 <div id="console"></div>
 
-<p>Normal Embed:<br><embed id='normal-embed' src="" type="application/x-shockwave-flash" width="425" height="350"></p>
-<p>E-link Embed:<br><embed id='elink-embed' src="" type="application/x-shockwave-flash" width="425" height="350"></p>
-<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="" type="application/x-shockwave-flash" width="425" height="350" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
-<p>Object without embed:<br><object id='object-no-embed' width="425" height="350" type="application/x-shockwave-flash" data=""
-<p>Embed inside iframe:<br>
-<iframe width="300" height="200"id='container-iframe'  src='' >
-</iframe>
+<div id="test-container">
+    <p>Normal Embed:<br><embed id="normal-embed" src="" type="application/x-shockwave-flash" width="425" height="350"></p>
+    <p>E-link Embed:<br><embed id="elink-embed" src="" type="application/x-shockwave-flash" width="425" height="350"></p>
+    <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="" type="application/x-shockwave-flash" width="425" height="350" allowscriptaccess="always" allowfullscreen="true"></embed>
+        </object>
+    </p>
+    <p>Object without embed:<br><object id="object-no-embed" width="425" height="350" type="application/x-shockwave-flash" data=""
+    <p>Embed inside iframe:<br>
+    <iframe width="300" height="200" id="test-iframe"></iframe>
+</div>
 
 <script src=""
 </body>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to