WebKit Bugzilla
Attachment 341466 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 for landing
bug-185406-20180528200845.patch (text/plain), 2.68 KB, created by
Sihui Liu
on 2018-05-28 20:08:46 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2018-05-28 20:08:46 PDT
Size:
2.68 KB
patch
obsolete
>Subversion Revision: 232250 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ab7261f1a377c362039757370ea4d9f33b2d1423..c65cfd9ca35ba2e69d435a456513d463e7138fba 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-28 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 Geoffrey Garen. >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: >+ (TEST): >+ > 2018-05-28 Thibault Saunier <tsaunier@igalia.com> > > [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >index 8f94b34d6d03a85cab77ad7ec71878389e90467f..111b567a91f998da18dc152d909370955a92ce73 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> > #import <wtf/Seconds.h> > #import <wtf/text/WTFString.h> >@@ -194,6 +195,41 @@ TEST(WebKit, WKHTTPCookieStore) > runTestWithWebsiteDataStore([WKWebsiteDataStore defaultDataStore]); > } > >+TEST(WebKit, WKHTTPCookieStoreProcessPrivilege) >+{ >+ // Make sure UI process has no privilege at the beginning. >+ WTF::setProcessPrivileges({ }); >+ >+ [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:[] { >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ >+ globalCookieStore = [[WKWebsiteDataStore defaultDataStore] 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