Changeset 226902 in webkit


Ignore:
Timestamp:
Jan 12, 2018 11:19:07 AM (6 years ago)
Author:
Simon Fraser
Message:

fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html is flakey
https://bugs.webkit.org/show_bug.cgi?id=181569
rdar://problem/34117680

Reviewed by Zalan Bujtas.

Wait a tick before starting the rotation, otherwise -[WKWebView _beginAnimatedResizeWithUpdates:]
can bail because the unobscuredRect is empty.

Also wait for both the rotation UI script to complete, and the receipt of the
orientationchange event.

  • fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html:
  • fast/events/ios/rotation/resources/rotation-utils.js:

(doTest):

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r226896 r226902  
     12018-01-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html is flakey
     4        https://bugs.webkit.org/show_bug.cgi?id=181569
     5        rdar://problem/34117680
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        Wait a tick before starting the rotation, otherwise -[WKWebView _beginAnimatedResizeWithUpdates:]
     10        can bail because the unobscuredRect is empty.
     11
     12        Also wait for both the rotation UI script to complete, and the receipt of the
     13        orientationchange event.
     14
     15        * fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html:
     16        * fast/events/ios/rotation/resources/rotation-utils.js:
     17        (doTest):
     18
    1192018-01-12  Matt Lewis  <jlewis3@apple.com>
    220
  • trunk/LayoutTests/fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html

    r216352 r226902  
    3333        }
    3434       
     35        var rotationComplete = false;
     36        var gotOrientationChange = false;
     37       
     38        function rotationFinished()
     39        {
     40            rotationComplete = true;
     41            checkForCompletion();
     42        }
     43       
     44        function checkForCompletion()
     45        {
     46            if (rotationComplete && gotOrientationChange) {
     47                if (window.testRunner)
     48                    testRunner.notifyDone();
     49            }
     50        }
     51
    3552        window.addEventListener('resize', function() {
    3653            accumulateLog('');
     
    4461            accumulateLog('(This will trigger the resize handler by forcing a layout.)');
    4562            logFixedAndViewports();
     63            gotOrientationChange = true;
    4664        }, false);
    4765
    48         window.addEventListener('load', doTest, false);
     66        window.addEventListener('load', function() {
     67            setTimeout(function() {
     68                doTest(rotationFinished);
     69            }, 0);
     70        }, false);
    4971    </script>
    5072</head>
  • trunk/LayoutTests/fast/events/ios/rotation/resources/rotation-utils.js

    r216352 r226902  
    2828}
    2929
    30 function doTest()
     30function doTest(scriptCompleteCallback)
    3131{
    3232    accumulateLog('Before rotation');
     
    4444        document.body.appendChild(logPre);
    4545
    46         if (window.testRunner)
    47             testRunner.notifyDone();
     46        if (scriptCompleteCallback)
     47            scriptCompleteCallback();
     48        else {
     49            if (window.testRunner)
     50                testRunner.notifyDone();
     51        }
    4852    });
    4953}
Note: See TracChangeset for help on using the changeset viewer.