WebKit Bugzilla
Attachment 362565 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-20190220163137.patch (text/plain), 4.03 KB, created by
Chris Dumez
on 2019-02-20 16:31:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-02-20 16:31:38 PST
Size:
4.03 KB
patch
obsolete
>Subversion Revision: 241851 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 288beb00887dce845327863a33c163cdf3fda7bc..2eade4224053ffeeb1dbfb1d666f4507bd2b8247 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-20 Chris Dumez <cdumez@apple.com> >+ >+ Add API test for <rdar://problem/47471222> >+ https://bugs.webkit.org/show_bug.cgi?id=194847 >+ >+ Reviewed by Alex Christensen. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: >+ > 2019-02-20 Chris Dumez <cdumez@apple.com> > > Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >index ae764b5dfb273acfb741df996e2d10165301d7f5..37f6773b0c873257db494963ae1cfc8ba1c0e73c 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >@@ -4396,6 +4396,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