WebKit Bugzilla
Attachment 342220 Details for
Bug 186417
: Add a API test for r232601
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186417-20180607162917.patch (text/plain), 3.73 KB, created by
Tim Horton
on 2018-06-07 16:29:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-06-07 16:29:18 PDT
Size:
3.73 KB
patch
obsolete
>Subversion Revision: 232603 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8df8c9f4eef261639cf2c014c0da5bf6c76881a3..9cfb73d1d1ed70f0154b3529a9010f8315bad912 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-07 Tim Horton <timothy_horton@apple.com> >+ >+ Add a API test for r232601 >+ https://bugs.webkit.org/show_bug.cgi?id=186417 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm: >+ (immediateSubviewOfClass): >+ (TEST): >+ Ensure that we put the view hierarchy back together (move WKContentView >+ out of the animated resize view) and unhide WKContentView after a >+ resize-with-hidden-content. >+ > 2018-06-07 Mark Lam <mark.lam@apple.com> > > Enhance run-jsc-stress-tests to allow a test to specify test specific options required for it to run. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm >index 0d14ed71e5d3c45c08905711790718d94fb4baa8..2213beaaa6d7f6212b7d6f8c19e8bd156e5ac607 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm >@@ -26,6 +26,7 @@ > #include "config.h" > > #import "PlatformUtilities.h" >+#import "Test.h" > #import "TestNavigationDelegate.h" > #import <WebKit/WKPreferences.h> > #import <WebKit/WKProcessPoolPrivate.h> >@@ -288,4 +289,62 @@ TEST(WebKit, OverrideLayoutSizeIsRestoredAfterChangingDuringProcessRelaunch) > TestWebKitAPI::Util::run(&didReadLayoutSize); > } > >+static UIView *immediateSubviewOfClass(UIView *view, Class cls) >+{ >+ UIView *foundSubview = nil; >+ >+ for (UIView *subview in view.subviews) { >+ if ([subview isKindOfClass:cls]) { >+ // Make it harder to write a bad test; if there's more than one subview >+ // of the given class, fail the test! >+ ASSERT(!foundSubview); >+ >+ foundSubview = subview; >+ } >+ } >+ >+ return foundSubview; >+} >+ >+TEST(WebKit, ResizeWithContentHiddenCompletes) >+{ >+ auto webView = createAnimatedResizeWebView(); >+ [webView setUIDelegate:webView.get()]; >+ >+ [webView loadHTMLString:@"<head><meta name='viewport' content='initial-scale=1'></head>" baseURL:nil]; >+ auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]); >+ webView.get().navigationDelegate = navigationDelegate.get(); >+ [navigationDelegate waitForDidFinishNavigation]; >+ >+ auto window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]); >+ [window addSubview:webView.get()]; >+ [window setHidden:NO]; >+ >+ [webView _resizeWhileHidingContentWithUpdates:^{ >+ [webView setFrame:CGRectMake(0, 0, 100, 200)]; >+ }]; >+ >+ __block bool didReadLayoutSize = false; >+ [webView _doAfterNextPresentationUpdate:^{ >+ [webView evaluateJavaScript:@"[window.innerWidth, window.innerHeight]" completionHandler:^(id value, NSError *error) { >+ CGFloat innerWidth = [[value objectAtIndex:0] floatValue]; >+ CGFloat innerHeight = [[value objectAtIndex:1] floatValue]; >+ >+ EXPECT_EQ(innerWidth, 100); >+ EXPECT_EQ(innerHeight, 200); >+ >+ didReadLayoutSize = true; >+ }]; >+ }]; >+ TestWebKitAPI::Util::run(&didReadLayoutSize); >+ >+ UIView *scrollView = immediateSubviewOfClass(webView.get(), NSClassFromString(@"WKScrollView")); >+ UIView *contentView = immediateSubviewOfClass(scrollView, NSClassFromString(@"WKContentView")); >+ >+ // Make sure that we've put the view hierarchy back together after the resize completed. >+ EXPECT_NOT_NULL(scrollView); >+ EXPECT_NOT_NULL(contentView); >+ EXPECT_FALSE(contentView.hidden); >+} >+ > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186417
: 342220 |
342226