Changeset 262387 in webkit


Ignore:
Timestamp:
Jun 1, 2020 11:21:50 AM (4 years ago)
Author:
achristensen@apple.com
Message:

Make CustomDisplayName and DefaultDisplayName API tests fail instead of timing out when something changes
https://bugs.webkit.org/show_bug.cgi?id=212480

This saves time when debugging and running all the tests.

  • TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm:

(TestWebKitAPI::checkUntilDisplayNameIs):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r262384 r262387  
     12020-06-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make CustomDisplayName and DefaultDisplayName API tests fail instead of timing out when something changes
     4        https://bugs.webkit.org/show_bug.cgi?id=212480
     5
     6        This saves time when debugging and running all the tests.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm:
     9        (TestWebKitAPI::checkUntilDisplayNameIs):
     10
    1112020-06-01  Philippe Normand  <pnormand@igalia.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm

    r260971 r262387  
    4242
    4343#if PLATFORM(MAC)
    44 static void checkUntilDisplayNameIs(WKWebView *webView, NSString *expectedName, bool* done)
     44static void checkUntilDisplayNameIs(WKWebView *webView, NSString *expectedName, bool* done, size_t iterations = 20)
    4545{
    4646    [webView _getProcessDisplayNameWithCompletionHandler:^(NSString *name) {
    4747        if ([name isEqualToString:expectedName])
    4848            *done = true;
    49         else
    50             checkUntilDisplayNameIs(webView, expectedName, done);
     49        else if (!iterations) {
     50            EXPECT_FALSE(true);
     51            *done = true;
     52        } else
     53            checkUntilDisplayNameIs(webView, expectedName, done, iterations - 1);
    5154    }];
    5255}
Note: See TracChangeset for help on using the changeset viewer.