Changeset 190133 in webkit


Ignore:
Timestamp:
Sep 22, 2015 2:11:35 PM (9 years ago)
Author:
aestes@apple.com
Message:

ContentFiltering.AllowDownloadAfterAddData is very flaky
https://bugs.webkit.org/show_bug.cgi?id=148885
<rdar://problem/22729563>

Reviewed by Alexey Proskuryakov.

The AllowDownload* tests were relying on -_downloadDidStart: being called before -webView:didFinishNavigation:,
but there is no guarantee of this. For tests that should allow a download, spin the runloop until
-_downloadDidStart: is called. The test will now timeout on failure, but will no longer produce false failures.

  • TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:

(downloadTest):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r190127 r190133  
     12015-09-22  Andy Estes  <aestes@apple.com>
     2
     3        ContentFiltering.AllowDownloadAfterAddData is very flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=148885
     5        <rdar://problem/22729563>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        The AllowDownload* tests were relying on -_downloadDidStart: being called before -webView:didFinishNavigation:,
     10        but there is no guarantee of this. For tests that should allow a download, spin the runloop until
     11        -_downloadDidStart: is called. The test will now timeout on failure, but will no longer produce false failures.
     12
     13        * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
     14        (downloadTest):
     15
    1162015-09-22  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm

    r189193 r190133  
    186186        isDone = false;
    187187        downloadDidStart = false;
    188         TestWebKitAPI::Util::run(&isDone);
    189 
    190188        const bool downloadShouldStart = decision == Decision::Allow || decisionPoint > DecisionPoint::AfterResponse;
     189        if (downloadShouldStart)
     190            TestWebKitAPI::Util::run(&downloadDidStart);
     191        else
     192            TestWebKitAPI::Util::run(&isDone);
     193
    191194        EXPECT_EQ(downloadShouldStart, downloadDidStart);
    192195
Note: See TracChangeset for help on using the changeset viewer.