Changeset 239359 in webkit


Ignore:
Timestamp:
Dec 18, 2018 3:59:34 PM (5 years ago)
Author:
david_quesada@apple.com
Message:

REGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=192810
<rdar://problem/46812536>

Reviewed by Alex Christensen.

  • TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

(-[OriginatingWebViewDownloadDelegate _downloadDidStart:]):

After releasing our reference to the web view, wait until the next turn of the runloop
before checking that the originatingWebView has been zeroed, since the web view might
still be referenced in the autorelease pool. This _WKDownload unit test isn't about
testing general memory management of WKWebViews, only that _WKDownload does not retain
its web view via the 'originatingWebView' property.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r239358 r239359  
     12018-12-18  David Quesada  <david_quesada@apple.com>
     2
     3        REGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=192810
     5        <rdar://problem/46812536>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
     10        (-[OriginatingWebViewDownloadDelegate _downloadDidStart:]):
     11            After releasing our reference to the web view, wait until the next turn of the runloop
     12            before checking that the originatingWebView has been zeroed, since the web view might
     13            still be referenced in the autorelease pool. This _WKDownload unit test isn't about
     14            testing general memory management of WKWebViews, only that _WKDownload does not retain
     15            its web view via the 'originatingWebView' property.
     16
    1172018-12-18  Sihui Liu  <sihui_liu@apple.com>
    218
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm

    r238381 r239359  
    4242#import <WebKit/WKWebView.h>
    4343#import <WebKit/WKWebViewConfiguration.h>
     44#import <wtf/MainThread.h>
    4445#import <wtf/RetainPtr.h>
    4546#import <wtf/text/WTFString.h>
     
    254255- (void)_downloadDidStart:(_WKDownload *)download
    255256{
    256     @autoreleasepool {
    257         EXPECT_EQ([download originatingWebView], _webView);
    258     }
    259 
     257    EXPECT_EQ([download originatingWebView], _webView);
    260258    _webView = nullptr;
    261     EXPECT_NULL([download originatingWebView]);
    262     isDone = true;
     259
     260    WTF::callOnMainThread([download = retainPtr(download)] {
     261        EXPECT_NULL([download originatingWebView]);
     262        isDone = true;
     263    });
    263264}
    264265
Note: See TracChangeset for help on using the changeset viewer.