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

Changeset 245663 in webkit


Ignore:
Timestamp:
May 22, 2019, 5:41:47 PM (7 years ago)
Author:
Wenson Hsieh
Message:

[iOS] The shouldIgnoreMetaViewport test option incorrectly persists across layout tests
https://bugs.webkit.org/show_bug.cgi?id=198135
<rdar://problem/51001306>

Reviewed by Alexey Proskuryakov.

Tools:

When shouldIgnoreMetaViewport=true is specified on a test, if the following test does not use a flexible
viewport, we will continue ignoring the meta viewport, since we'll bail before we attempt to reset
WKPreferences' _shouldIgnoreMetaViewport property to NO.

We fix this by simply allowing shouldIgnoreMetaViewport to take precedence over useFlexibleViewport, such that
-[WKPreferences _shouldIgnoreMetaViewport] will always be updated to its intended value between tests.

  • WebKitTestRunner/ios/TestControllerIOS.mm:

(WTR::TestController::platformConfigureViewForTest):

LayoutTests:

Attempt to fix a handful of viewport tests that currently try to wait for the next visible content rect update,
but end up timing out in the process. Instead, only wait for the presentation update, which is guaranteed to
happen.

  • fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html:
  • fast/viewport/ios/device-width-viewport-after-changing-view-scale.html:
  • fast/viewport/ios/initial-scale-after-changing-view-scale.html:
  • fast/viewport/ios/minimum-scale-after-changing-view-scale.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245662 r245663  
     12019-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] The shouldIgnoreMetaViewport test option incorrectly persists across layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=198135
     5        <rdar://problem/51001306>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        Attempt to fix a handful of viewport tests that currently try to wait for the next visible content rect update,
     10        but end up timing out in the process. Instead, only wait for the presentation update, which is guaranteed to
     11        happen.
     12
     13        * fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html:
     14        * fast/viewport/ios/device-width-viewport-after-changing-view-scale.html:
     15        * fast/viewport/ios/initial-scale-after-changing-view-scale.html:
     16        * fast/viewport/ios/minimum-scale-after-changing-view-scale.html:
     17
    1182019-05-22  Saam barati  <sbarati@apple.com>
    219
  • trunk/LayoutTests/fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html

    r237743 r245663  
    4040
    4141            await UIHelper.setViewScale(targetScale);
    42             await Promise.all([UIHelper.ensureVisibleContentRectUpdate(), UIHelper.ensurePresentationUpdate()]);
     42            await UIHelper.ensurePresentationUpdate();
    4343
    4444            appendOutput(`window size: [${innerWidth}, ${innerHeight}]`);
  • trunk/LayoutTests/fast/viewport/ios/device-width-viewport-after-changing-view-scale.html

    r237743 r245663  
    4040
    4141            await UIHelper.setViewScale(targetScale);
    42             await Promise.all([UIHelper.ensureVisibleContentRectUpdate(), UIHelper.ensurePresentationUpdate()]);
     42            await UIHelper.ensurePresentationUpdate();
    4343
    4444            appendOutput(`window size: [${innerWidth}, ${innerHeight}]`);
  • trunk/LayoutTests/fast/viewport/ios/initial-scale-after-changing-view-scale.html

    r242059 r245663  
    4141        return new Promise(async resolve => {
    4242            await UIHelper.setViewScale(scale);
    43             await Promise.all([UIHelper.ensureVisibleContentRectUpdate(), UIHelper.ensurePresentationUpdate()]);
     43            await UIHelper.ensurePresentationUpdate();
    4444            resolve(internals.pageScaleFactor().toFixed(2));
    4545        });
  • trunk/LayoutTests/fast/viewport/ios/minimum-scale-after-changing-view-scale.html

    r242069 r245663  
    3232        for (const scale of [1.15, 1.25, 1.5, 1.75, 2, 2.5, 3, 1]) {
    3333            await UIHelper.setViewScale(scale);
    34             await Promise.all([UIHelper.ensureVisibleContentRectUpdate(), UIHelper.ensurePresentationUpdate()]);
     34            await UIHelper.ensurePresentationUpdate();
    3535            appendOutput(`After setting the view scale to ${scale}, the minimum scale is: ${(await UIHelper.minimumZoomScale()).toFixed(5)}`);
    3636            appendOutput(`After setting the view scale to ${scale}, the current scale is: ${(await UIHelper.zoomScale()).toFixed(5)}`);
  • trunk/Tools/ChangeLog

    r245649 r245663  
     12019-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] The shouldIgnoreMetaViewport test option incorrectly persists across layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=198135
     5        <rdar://problem/51001306>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        When shouldIgnoreMetaViewport=true is specified on a test, if the following test does not use a flexible
     10        viewport, we will continue ignoring the meta viewport, since we'll bail before we attempt to reset
     11        WKPreferences' _shouldIgnoreMetaViewport property to NO.
     12
     13        We fix this by simply allowing shouldIgnoreMetaViewport to take precedence over useFlexibleViewport, such that
     14        -[WKPreferences _shouldIgnoreMetaViewport] will always be updated to its intended value between tests.
     15
     16        * WebKitTestRunner/ios/TestControllerIOS.mm:
     17        (WTR::TestController::platformConfigureViewForTest):
     18
    1192019-05-22  Sihui Liu  <sihui_liu@apple.com>
    220
  • trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm

    r244955 r245663  
    188188void TestController::platformConfigureViewForTest(const TestInvocation& test)
    189189{
     190    TestRunnerWKWebView *webView = mainWebView()->platformView();
     191
     192    webView.configuration.preferences._shouldIgnoreMetaViewport = test.options().shouldIgnoreMetaViewport;
     193
    190194    if (!test.options().useFlexibleViewport)
    191195        return;
    192        
    193     TestRunnerWKWebView *webView = mainWebView()->platformView();
    194 
    195     webView.configuration.preferences._shouldIgnoreMetaViewport = test.options().shouldIgnoreMetaViewport;
    196196
    197197    CGRect screenBounds = [UIScreen mainScreen].bounds;
Note: See TracChangeset for help on using the changeset viewer.