Changeset 238241 in webkit


Ignore:
Timestamp:
Nov 15, 2018 12:32:38 PM (5 years ago)
Author:
timothy@apple.com
Message:

REGRESSION (r238212): WebKit.BackgroundColor* API test failures.
https://bugs.webkit.org/show_bug.cgi?id=191697
rdar://problem/46098570

Reviewed by Dean Jackson.

  • TestWebKitAPI/Tests/mac/BackgroundColor.mm:

(TestWebKitAPI::TEST): Updated for new default background color.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r238237 r238241  
     12018-11-15  Timothy Hatcher  <timothy@apple.com>
     2
     3        REGRESSION (r238212): WebKit.BackgroundColor* API test failures.
     4        https://bugs.webkit.org/show_bug.cgi?id=191697
     5        rdar://problem/46098570
     6
     7        Reviewed by Dean Jackson.
     8
     9        * TestWebKitAPI/Tests/mac/BackgroundColor.mm:
     10        (TestWebKitAPI::TEST): Updated for new default background color.
     11
    1122018-11-15  Jonathan Bedard  <jbedard@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/mac/BackgroundColor.mm

    r230866 r238241  
    3535namespace TestWebKitAPI {
    3636
     37#if ENABLE(DARK_MODE_CSS)
     38#define DEFAULT_BACKGROUND_COLOR [NSColor controlBackgroundColor]
     39#else
     40#define DEFAULT_BACKGROUND_COLOR [NSColor whiteColor]
     41#endif
     42
    3743TEST(WebKit, BackgroundColorDefault)
    3844{
    3945    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
    4046
     47    NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR;
    4148    NSColor *backgroundColor = [webView _backgroundColor];
    42     EXPECT_EQ([NSColor whiteColor], backgroundColor);
     49    EXPECT_EQ(defaultColor, backgroundColor);
    4350
    4451    // Load content so the layer is created.
    4552    [webView synchronouslyLoadHTMLString:@""];
    4653
    47     EXPECT_EQ(CGColorGetConstantColor(kCGColorWhite), [webView layer].backgroundColor);
     54    EXPECT_TRUE(CGColorEqualToColor(defaultColor.CGColor, [webView layer].backgroundColor));
    4855}
    4956
     
    5259    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
    5360
    54     [webView _setBackgroundColor:[NSColor controlBackgroundColor]];
     61    NSColor *systemColor = [NSColor textBackgroundColor];
     62    [webView _setBackgroundColor:systemColor];
    5563
    5664    NSColor *backgroundColor = [webView _backgroundColor];
    57     EXPECT_EQ([NSColor controlBackgroundColor], backgroundColor);
     65    EXPECT_EQ(systemColor, backgroundColor);
    5866
    5967    // Load content so the layer is created.
    6068    [webView synchronouslyLoadHTMLString:@""];
    6169
    62     EXPECT_TRUE(CGColorEqualToColor([NSColor controlBackgroundColor].CGColor, [webView layer].backgroundColor));
     70    EXPECT_TRUE(CGColorEqualToColor(systemColor.CGColor, [webView layer].backgroundColor));
    6371}
    6472
     
    6977    [webView _setBackgroundColor:nil];
    7078
     79    NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR;
    7180    NSColor *backgroundColor = [webView _backgroundColor];
    72     EXPECT_EQ([NSColor whiteColor], backgroundColor);
     81    EXPECT_EQ(defaultColor, backgroundColor);
    7382
    7483    // Load content so the layer is created.
    7584    [webView synchronouslyLoadHTMLString:@""];
    7685
    77     EXPECT_EQ(CGColorGetConstantColor(kCGColorWhite), [webView layer].backgroundColor);
     86    EXPECT_TRUE(CGColorEqualToColor(defaultColor.CGColor, [webView layer].backgroundColor));
    7887}
    7988
     
    8493    [webView _setDrawsBackground:NO];
    8594
     95    NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR;
    8696    NSColor *backgroundColor = [webView _backgroundColor];
    87     EXPECT_EQ([NSColor whiteColor], backgroundColor);
     97    EXPECT_EQ(defaultColor, backgroundColor);
    8898
    8999    // Load content so the layer is created.
     
    98108
    99109    [webView _setDrawsBackground:NO];
    100     [webView _setBackgroundColor:[NSColor controlBackgroundColor]];
     110    [webView _setBackgroundColor:[NSColor textBackgroundColor]];
    101111
    102112    NSColor *backgroundColor = [webView _backgroundColor];
    103     EXPECT_EQ([NSColor controlBackgroundColor], backgroundColor);
     113    EXPECT_EQ([NSColor textBackgroundColor], backgroundColor);
    104114
    105115    // Load content so the layer is created.
Note: See TracChangeset for help on using the changeset viewer.