Changeset 238241 in webkit
- Timestamp:
- Nov 15, 2018 12:32:38 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r238237 r238241 1 2018-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 1 12 2018-11-15 Jonathan Bedard <jbedard@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/mac/BackgroundColor.mm
r230866 r238241 35 35 namespace TestWebKitAPI { 36 36 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 37 43 TEST(WebKit, BackgroundColorDefault) 38 44 { 39 45 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); 40 46 47 NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR; 41 48 NSColor *backgroundColor = [webView _backgroundColor]; 42 EXPECT_EQ( [NSColor whiteColor], backgroundColor);49 EXPECT_EQ(defaultColor, backgroundColor); 43 50 44 51 // Load content so the layer is created. 45 52 [webView synchronouslyLoadHTMLString:@""]; 46 53 47 EXPECT_ EQ(CGColorGetConstantColor(kCGColorWhite), [webView layer].backgroundColor);54 EXPECT_TRUE(CGColorEqualToColor(defaultColor.CGColor, [webView layer].backgroundColor)); 48 55 } 49 56 … … 52 59 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); 53 60 54 [webView _setBackgroundColor:[NSColor controlBackgroundColor]]; 61 NSColor *systemColor = [NSColor textBackgroundColor]; 62 [webView _setBackgroundColor:systemColor]; 55 63 56 64 NSColor *backgroundColor = [webView _backgroundColor]; 57 EXPECT_EQ( [NSColor controlBackgroundColor], backgroundColor);65 EXPECT_EQ(systemColor, backgroundColor); 58 66 59 67 // Load content so the layer is created. 60 68 [webView synchronouslyLoadHTMLString:@""]; 61 69 62 EXPECT_TRUE(CGColorEqualToColor( [NSColor controlBackgroundColor].CGColor, [webView layer].backgroundColor));70 EXPECT_TRUE(CGColorEqualToColor(systemColor.CGColor, [webView layer].backgroundColor)); 63 71 } 64 72 … … 69 77 [webView _setBackgroundColor:nil]; 70 78 79 NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR; 71 80 NSColor *backgroundColor = [webView _backgroundColor]; 72 EXPECT_EQ( [NSColor whiteColor], backgroundColor);81 EXPECT_EQ(defaultColor, backgroundColor); 73 82 74 83 // Load content so the layer is created. 75 84 [webView synchronouslyLoadHTMLString:@""]; 76 85 77 EXPECT_ EQ(CGColorGetConstantColor(kCGColorWhite), [webView layer].backgroundColor);86 EXPECT_TRUE(CGColorEqualToColor(defaultColor.CGColor, [webView layer].backgroundColor)); 78 87 } 79 88 … … 84 93 [webView _setDrawsBackground:NO]; 85 94 95 NSColor *defaultColor = DEFAULT_BACKGROUND_COLOR; 86 96 NSColor *backgroundColor = [webView _backgroundColor]; 87 EXPECT_EQ( [NSColor whiteColor], backgroundColor);97 EXPECT_EQ(defaultColor, backgroundColor); 88 98 89 99 // Load content so the layer is created. … … 98 108 99 109 [webView _setDrawsBackground:NO]; 100 [webView _setBackgroundColor:[NSColor controlBackgroundColor]];110 [webView _setBackgroundColor:[NSColor textBackgroundColor]]; 101 111 102 112 NSColor *backgroundColor = [webView _backgroundColor]; 103 EXPECT_EQ([NSColor controlBackgroundColor], backgroundColor);113 EXPECT_EQ([NSColor textBackgroundColor], backgroundColor); 104 114 105 115 // Load content so the layer is created.
Note: See TracChangeset
for help on using the changeset viewer.