Changeset 220952 in webkit
- Timestamp:
- Aug 19, 2017 1:46:16 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r220947 r220952 1 2017-08-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS WK2] Add a version of DataInteractionTests.ExternalSourceAttributedStringToContentEditable that doesn't hit a debug assertion 4 https://bugs.webkit.org/show_bug.cgi?id=175509 5 <rdar://problem/33728169> 6 7 Reviewed by Ryosuke Niwa. 8 9 Removes ExternalSourceAttributedStringToContentEditable and adds 10 ExternalSourceColoredAttributedStringToContentEditable, which tests dropping an attributed string with colored 11 text instead of a bold attributed string of system font. Due to a recent change in behavior in UIKit, the 12 original test (which this patch renames to ExternalSourceBoldSystemAttributedStringToContentEditable) hits a 13 debug assertion when dropping text of system bold font. Since the original intent of this test was to verify 14 that the attributed string UTI can be accepted in richly contenteditable areas, it suffices to check that some 15 other style attribute, such as color, carries over from the NSAttributedString to the DOM. 16 17 Also marks ExternalSourceBoldSystemAttributedStringToContentEditable as disabled for the time being. 18 19 * TestWebKitAPI/Tests/ios/DataInteractionTests.mm: 20 (TestWebKitAPI::TEST): 21 1 22 2017-08-18 Ryan Haddad <ryanhaddad@apple.com> 2 23 -
trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm
r220865 r220952 686 686 } 687 687 688 TEST(DataInteractionTests, ExternalSourceAttributedStringToContentEditable)688 TEST(DataInteractionTests, DISABLED_ExternalSourceBoldSystemAttributedStringToContentEditable) 689 689 { 690 690 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); … … 699 699 [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)]; 700 700 701 EXPECT_WK_STREQ("This is a test", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String); 702 } 703 704 TEST(DataInteractionTests, ExternalSourceColoredAttributedStringToContentEditable) 705 { 706 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); 707 [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"]; 708 [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"]; 709 710 auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]); 711 NSDictionary *textAttributes = @{ NSForegroundColorAttributeName: [UIColor redColor] }; 712 NSAttributedString *richText = [[NSAttributedString alloc] initWithString:@"This is a test" attributes:textAttributes]; 713 auto itemProvider = adoptNS([[UIItemProvider alloc] initWithObject:richText]); 714 [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]]; 715 [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)]; 716 717 EXPECT_WK_STREQ("rgb(255, 0, 0)", [webView stringByEvaluatingJavaScript:@"getComputedStyle(document.querySelector('p')).color"]); 701 718 EXPECT_WK_STREQ("This is a test", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String); 702 719 }
Note: See TracChangeset
for help on using the changeset viewer.