Changeset 204226 in webkit
- Timestamp:
- Aug 6, 2016 8:13:26 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r204222 r204226 1 2016-08-06 Chris Dumez <cdumez@apple.com> 2 3 Write API test to cover crash fix in r204135 4 https://bugs.webkit.org/show_bug.cgi?id=160587 5 6 Reviewed by Darin Adler. 7 8 Call didClose() in WebProcessProxy::requestTermination() so that 9 the processDidCrash() delegates get called in API tests whenever 10 a WebContent process is terminated to simulate a crash. 11 12 * UIProcess/WebProcessProxy.cpp: 13 (WebKit::WebProcessProxy::requestTermination): 14 1 15 2016-08-06 Brady Eidson <beidson@apple.com> 2 16 -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r203338 r204226 805 805 ChildProcessProxy::terminate(); 806 806 807 if (webConnection()) 808 webConnection()->didClose(); 807 didClose(*connection()); 809 808 810 809 shutDown(); -
trunk/Tools/ChangeLog
r204194 r204226 1 2016-08-06 Chris Dumez <cdumez@apple.com> 2 3 Write API test to cover crash fix in r204135 4 https://bugs.webkit.org/show_bug.cgi?id=160587 5 6 Reviewed by Darin Adler. 7 8 Add API test to cover crash fix in r204135. This reproduces the crash 9 by destroying a related WKWebView in the webViewWebContentProcessDidTerminate 10 callback. 11 12 * TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm: 13 (-[NavigationDelegate webViewWebContentProcessDidTerminate:]): 14 (TEST): 15 1 16 2016-08-05 Tim Horton <timothy_horton@apple.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm
r176096 r204226 28 28 #import <WebKit/WKNavigationPrivate.h> 29 29 #import <WebKit/WKNavigationDelegate.h> 30 #import <WebKit/WKProcessPoolPrivate.h> 30 31 #import <WebKit/WKWebView.h> 32 #import <WebKit/WKWebViewConfigurationPrivate.h> 33 #import <WebKit/WKWebViewPrivate.h> 34 #import <WebKit/_WKProcessPoolConfiguration.h> 31 35 #import <wtf/RetainPtr.h> 32 36 #import "PlatformUtilities.h" … … 36 40 37 41 static bool isDone; 42 static std::function<void()> crashHandler; 38 43 static RetainPtr<WKNavigation> currentNavigation; 39 44 … … 59 64 60 65 isDone = true; 66 } 67 68 - (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView 69 { 70 crashHandler(); 61 71 } 62 72 … … 188 198 } 189 199 200 TEST(WKNavigation, WebContentProcessDidTerminate) 201 { 202 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 203 RetainPtr<_WKProcessPoolConfiguration> poolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 204 poolConfiguration.get().maximumProcessCount = 1; 205 RetainPtr<WKProcessPool> processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:poolConfiguration.get()]); 206 207 RetainPtr<WKWebViewConfiguration> configuration1 = adoptNS([[WKWebViewConfiguration alloc] init]); 208 configuration1.get().processPool = processPool.get(); 209 RetainPtr<WKWebView> webView1 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration1.get()]); 210 211 RetainPtr<NavigationDelegate> delegate1 = adoptNS([[NavigationDelegate alloc] init]); 212 [webView1 setNavigationDelegate:delegate1.get()]; 213 214 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"data:text/html,1"]]; 215 216 isDone = false; 217 currentNavigation = [webView1 loadRequest:request]; 218 TestWebKitAPI::Util::run(&isDone); 219 220 RetainPtr<WKWebViewConfiguration> configuration2 = adoptNS([[WKWebViewConfiguration alloc] init]); 221 configuration2.get().processPool = processPool.get(); 222 configuration2.get()._relatedWebView = webView1.get(); 223 RetainPtr<WKWebView> webView2 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration2.get()]); 224 225 RetainPtr<NavigationDelegate> delegate2 = adoptNS([[NavigationDelegate alloc] init]); 226 [webView2 setNavigationDelegate:delegate2.get()]; 227 228 isDone = false; 229 currentNavigation = [webView2 loadRequest:request]; 230 TestWebKitAPI::Util::run(&isDone); 231 232 bool didTerminate = false; 233 crashHandler = [&] { 234 webView1 = nullptr; 235 webView2 = nullptr; 236 [pool drain]; // Make sure the views get deallocated. 237 didTerminate = true; 238 }; 239 240 [webView2 _killWebContentProcessAndResetState]; 241 TestWebKitAPI::Util::run(&didTerminate); 242 } 243 190 244 #endif
Note: See TracChangeset
for help on using the changeset viewer.