WebKit Bugzilla
Attachment 339780 Details for
Bug 185406
: Add an API test to check process privilege when using Cookie API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185406-20180507173050.patch (text/plain), 2.43 KB, created by
Sihui Liu
on 2018-05-07 17:30:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2018-05-07 17:30:50 PDT
Size:
2.43 KB
patch
obsolete
>Subversion Revision: 231371 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 836c9d616f95bb7dabe5cba67a8f3d4480862f47..08a9e5d801d3d5151f4f87652da3a4ab07891d48 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-07 Sihui Liu <sihui_liu@apple.com> >+ >+ Add an API test to check process privilege when using Cookie API >+ https://bugs.webkit.org/show_bug.cgi?id=185406 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: >+ (TEST): >+ > 2018-05-04 Wenson Hsieh <whsieh@berkeley.edu> > > REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >index 9d5d7ecd6dc2a4719cd7d49fcc0a254ecd619798..7ce8057160fa1c342043a0c47c9fdc57c2169b71 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >@@ -32,6 +32,7 @@ > #import <WebKit/WKProcessPoolPrivate.h> > #import <WebKit/WKWebsiteDataStorePrivate.h> > #import <WebKit/_WKWebsiteDataStoreConfiguration.h> >+#import <wtf/ProcessPrivilege.h> > #import <wtf/RetainPtr.h> > > #if WK_API_ENABLED >@@ -192,6 +193,35 @@ TEST(WebKit, WKHTTPCookieStore) > runTestWithWebsiteDataStore([WKWebsiteDataStore defaultDataStore]); > } > >+TEST(WebKit, WKHTTPCookieStoreProcessPrivilege) >+{ >+ // Make sure UI process has no privilege at the beginning. >+ WTF::setProcessPrivileges({ }); >+ >+ WKWebsiteDataStore* dataStore = [WKWebsiteDataStore defaultDataStore]; >+ globalCookieStore = dataStore.httpCookieStore; >+ >+ RetainPtr<NSHTTPCookie> cookie = [NSHTTPCookie cookieWithProperties:@{ >+ NSHTTPCookiePath: @"/", >+ NSHTTPCookieName: @"Cookie", >+ NSHTTPCookieValue: @"Value", >+ NSHTTPCookieDomain: @".www.webkit.org", >+ }]; >+ >+ [globalCookieStore setCookie:cookie.get() completionHandler:[]() { >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ >+ [globalCookieStore getAllCookies:^(NSArray<NSHTTPCookie *>*cookies) { >+ ASSERT_EQ(1u, cookies.count); >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+} >+ > TEST(WebKit, WKHTTPCookieStoreHttpOnly) > { > WKWebsiteDataStore* dataStore = [WKWebsiteDataStore defaultDataStore];
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 185406
:
339779
|
339780
|
341466