WebKit Bugzilla
Attachment 362471 Details for
Bug 194847
: Add API test for <rdar://problem/47471222>
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194847-20190219190727.patch (text/plain), 3.97 KB, created by
Chris Dumez
on 2019-02-19 19:07:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-02-19 19:07:29 PST
Size:
3.97 KB
patch
obsolete
>Subversion Revision: 241789 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index cd6b717d98e8c30234d78b37bfa9cde280afc00c..4f52e82ce21fa2159c7757dfc8762fa9bea8c8d5 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-19 Chris Dumez <cdumez@apple.com> >+ >+ Add API test for <rdar://problem/47471222> >+ https://bugs.webkit.org/show_bug.cgi?id=194847 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: >+ > 2019-02-19 Keith Rollin <krollin@apple.com> > > Add timing information to build output >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >index 8c96bec03b3e70ffddaa349a562d72c55a41d5ef..0ac2ee810396c6049e7bf60f47125e3a9c8de16d 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >@@ -4347,6 +4347,73 @@ TEST(ProcessSwap, UseSessionCookiesAfterProcessSwapInPrivateBrowsing) > EXPECT_WK_STREQ(@"foo=bar", receivedMessages.get()[0]); > } > >+TEST(ProcessSwap, UseSessionCookiesAfterProcessSwapInNonDefaultPersistentSession) >+{ >+ auto processPoolConfiguration = psonProcessPoolConfiguration(); >+ >+ // Prevent WebProcess reuse. >+ processPoolConfiguration.get().usesWebProcessCache = NO; >+ processPoolConfiguration.get().pageCacheEnabled = NO; >+ processPoolConfiguration.get().prewarmsProcessesAutomatically = NO; >+ >+ auto websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); >+ auto customDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]); >+ >+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); >+ >+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ >+ [webViewConfiguration setProcessPool:processPool.get()]; >+ webViewConfiguration.get().websiteDataStore = customDataStore.get(); >+ >+ auto handler = adoptNS([[PSONScheme alloc] init]); >+ [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"pson"]; >+ >+ auto messageHandler = adoptNS([[PSONMessageHandler alloc] init]); >+ [[webViewConfiguration userContentController] addScriptMessageHandler:messageHandler.get() name:@"testHandler"]; >+ >+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); >+ auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); >+ [webView setNavigationDelegate:delegate.get()]; >+ >+ [processPool _setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; >+ >+ NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetSessionCookie" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ auto pid1 = [webView _webProcessIdentifier]; >+ >+ // Should process-swap. >+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ auto pid2 = [webView _webProcessIdentifier]; >+ EXPECT_NE(pid1, pid2); >+ >+ // Should process-swap. >+ request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"GetSessionCookie" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ auto pid3 = [webView _webProcessIdentifier]; >+ EXPECT_NE(pid2, pid3); >+ EXPECT_NE(pid1, pid3); >+ >+ TestWebKitAPI::Util::run(&receivedMessage); >+ receivedMessage = false; >+ >+ EXPECT_EQ(1u, [receivedMessages count]); >+ EXPECT_WK_STREQ(@"foo=bar", receivedMessages.get()[0]); >+} >+ > #if PLATFORM(MAC) > > TEST(ProcessSwap, TerminateProcessAfterProcessSwap)
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 194847
:
362471
|
362565