Changeset 223800 in webkit


Ignore:
Timestamp:
Oct 20, 2017 4:55:35 PM (6 years ago)
Author:
rniwa@webkit.org
Message:

http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=178606

Reviewed by Wenson Hsieh.

The bug was caused by the race condition during the page loading of iframes.

Waiting for message event wasn't doing anything useful because it was receiving the message from
source iframe before the drag & drop had started.

Fixed the bug by waiting for the second message event. Also replaced the wait for load event
by the wait for the first message event for clarity.

  • http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r223799 r223800  
     12017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=178606
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        The bug was caused by the race condition during the page loading of iframes.
     9
     10        Waiting for message event wasn't doing anything useful because it was receiving the message from
     11        source iframe before the drag & drop had started.
     12
     13        Fixed the bug by waiting for the second message event. Also replaced the wait for load event
     14        by the wait for the first message event for clarity.
     15
     16        * http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html:
     17
    1182017-10-20  Ryan Haddad  <ryanhaddad@apple.com>
    219
  • trunk/LayoutTests/http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html

    r223678 r223800  
    2323jsTestIsAsync = true;
    2424
    25 window.onload = () => {
     25let loadCount = 0;
     26window.onmessage = (event) => {
     27    if (!loadCount++)
     28        runTest()
     29    else
     30        checkFrameAccess();
     31}
     32
     33function runTest() {
    2634    document.getElementById('source').focus();
    2735    document.execCommand('selectAll');
     
    5967    });
    6068    observer.observe(destination, {childList: true, subtree: true});
    61 
    62     window.onmessage = checkFrameAccess;
    6369}
    6470
Note: See TracChangeset for help on using the changeset viewer.