-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the delete function in the Cookie Store API
https://bugs.webkit.org/show_bug.cgi?id=259220 Reviewed by Chris Dumez. The delete function creates a cookie with the options given and sets the expires field to a time in the past (we set it to the epoch). Then it uses the Cookie Store API set function to set this cookie so that the CFNetwork will update the existing cookies with these options and delete them since they are expired. * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieListItem_attributes.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_delete_arguments.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_delete_basic.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_event_delete.https.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_getAll_arguments.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_getAll_multiple.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_getAll_set_basic.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_get_arguments.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_get_delete_basic.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_get_set_across_frames.https-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_get_set_basic.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_special_names.https.any-expected.txt: * Source/WebCore/Modules/cookie-store/CookieStore.cpp: (WebCore::CookieStore::remove): * Source/WebCore/Modules/cookie-store/CookieStore.h: Canonical link: https://commits.webkit.org/266078@main
- Loading branch information
1 parent
bbbec87
commit 525b38f
Showing
15 changed files
with
92 additions
and
81 deletions.
There are no files selected for viewing
20 changes: 10 additions & 10 deletions
20
...rted/w3c/web-platform-tests/cookie-store/cookieListItem_attributes.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
|
||
FAIL CookieListItem - cookieStore.set defaults with positional name and value promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set defaults with name and value in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with expires set to a timestamp 10 years in the future promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with expires set to a Date 10 years in the future promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with domain set to the current hostname promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with path set to the current directory promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set adds / to path if it does not end with / promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with sameSite set to strict promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with sameSite set to lax promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set with sameSite set to none promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL CookieListItem - cookieStore.set defaults with positional name and value assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set defaults with name and value in options assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with expires set to a timestamp 10 years in the future assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with expires set to a Date 10 years in the future assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with domain set to the current hostname assert_equals: expected (string) "localhost" but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with path set to the current directory assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set adds / to path if it does not end with / assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with sameSite set to strict assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with sameSite set to lax assert_equals: expected (object) null but got (undefined) undefined | ||
FAIL CookieListItem - cookieStore.set with sameSite set to none assert_equals: expected (object) null but got (undefined) undefined | ||
|
30 changes: 14 additions & 16 deletions
30
...d/w3c/web-platform-tests/cookie-store/cookieStore_delete_arguments.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.delete with name in options' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.delete with positional name promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.delete with name in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
NOTRUN cookieStore.delete domain starts with "." | ||
NOTRUN cookieStore.delete with domain that is not equal current host | ||
NOTRUN cookieStore.delete with domain set to the current hostname | ||
NOTRUN cookieStore.delete with domain set to a subdomain of the current hostname | ||
NOTRUN cookieStore.delete with domain set to a non-domain-matching suffix of the current hostname | ||
NOTRUN cookieStore.delete with path set to the current directory | ||
NOTRUN cookieStore.delete with path set to subdirectory of the current directory | ||
NOTRUN cookieStore.delete with missing / at the end of path | ||
NOTRUN cookieStore.delete with path that does not start with / | ||
NOTRUN cookieStore.delete with get result | ||
NOTRUN cookieStore.delete with positional empty name | ||
NOTRUN cookieStore.delete with empty name in options | ||
PASS cookieStore.delete with positional name | ||
PASS cookieStore.delete with name in options | ||
FAIL cookieStore.delete domain starts with "." assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.delete with domain that is not equal current host assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.delete with domain set to the current hostname assert_equals: expected null but got object "[object Object]" | ||
FAIL cookieStore.delete with domain set to a subdomain of the current hostname assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.delete with domain set to a non-domain-matching suffix of the current hostname assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.delete with path set to the current directory assert_equals: expected null but got object "[object Object]" | ||
PASS cookieStore.delete with path set to subdirectory of the current directory | ||
FAIL cookieStore.delete with missing / at the end of path assert_equals: expected null but got object "[object Object]" | ||
FAIL cookieStore.delete with path that does not start with / assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.delete with get result assert_equals: expected null but got object "[object Object]" | ||
FAIL cookieStore.delete with positional empty name promise_test: Unhandled rejection with value: object "TypeError: Type error" | ||
FAIL cookieStore.delete with empty name in options promise_test: Unhandled rejection with value: object "TypeError: Type error" | ||
|
2 changes: 1 addition & 1 deletion
2
...orted/w3c/web-platform-tests/cookie-store/cookieStore_delete_basic.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL cookieStore.delete return type is Promise<void> promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.delete return type is Promise<void> | ||
|
4 changes: 2 additions & 2 deletions
4
...ed/w3c/web-platform-tests/cookie-store/cookieStore_event_delete.https.window-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore fires change event for cookie deleted by cookieStore.delete()' specified 1 'cleanup' function, and 1 failed. | ||
Harness Error (TIMEOUT), message = null | ||
|
||
FAIL cookieStore fires change event for cookie deleted by cookieStore.delete() promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
TIMEOUT cookieStore fires change event for cookie deleted by cookieStore.delete() Test timed out | ||
|
22 changes: 12 additions & 10 deletions
22
...d/w3c/web-platform-tests/cookie-store/cookieStore_getAll_arguments.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.getAll with no arguments' specified 2 'cleanup' functions, and 2 failed. | ||
|
||
FAIL cookieStore.getAll with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
NOTRUN cookieStore.getAll with empty options | ||
NOTRUN cookieStore.getAll with positional name | ||
NOTRUN cookieStore.getAll with name in options | ||
NOTRUN cookieStore.getAll with name in both positional arguments and options | ||
NOTRUN cookieStore.getAll with absolute url in options | ||
NOTRUN cookieStore.getAll with relative url in options | ||
NOTRUN cookieStore.getAll with invalid url path in options | ||
NOTRUN cookieStore.getAll with invalid url host in options | ||
FAIL cookieStore.getAll with empty options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with positional name promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with name in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with name in both positional arguments and options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with absolute url in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with relative url in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.getAll with invalid url path in options promise_rejects_js: function "function() { throw e }" threw object "NotSupportedError: The operation is not supported." ("NotSupportedError") expected instance of function "function TypeError() { | ||
[native code] | ||
}" ("TypeError") | ||
FAIL cookieStore.getAll with invalid url host in options promise_rejects_js: function "function() { throw e }" threw object "NotSupportedError: The operation is not supported." ("NotSupportedError") expected instance of function "function TypeError() { | ||
[native code] | ||
}" ("TypeError") | ||
|
2 changes: 0 additions & 2 deletions
2
...ed/w3c/web-platform-tests/cookie-store/cookieStore_getAll_multiple.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.getAll returns multiple cookies written by cookieStore.set' specified 3 'cleanup' functions, and 3 failed. | ||
|
||
FAIL cookieStore.getAll returns multiple cookies written by cookieStore.set promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
|
2 changes: 0 additions & 2 deletions
2
...d/w3c/web-platform-tests/cookie-store/cookieStore_getAll_set_basic.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.getAll returns the cookie written by cookieStore.set' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.getAll returns the cookie written by cookieStore.set promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
|
18 changes: 8 additions & 10 deletions
18
...rted/w3c/web-platform-tests/cookie-store/cookieStore_get_arguments.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.get with no arguments returns TypeError' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.get with no arguments returns TypeError assert_unreached: Should have rejected: undefined Reached unreachable code | ||
NOTRUN cookieStore.get with empty options returns TypeError | ||
NOTRUN cookieStore.get with positional name | ||
NOTRUN cookieStore.get with name in options | ||
NOTRUN cookieStore.get with name in both positional arguments and options | ||
NOTRUN cookieStore.get with absolute url in options | ||
NOTRUN cookieStore.get with relative url in options | ||
NOTRUN cookieStore.get with invalid url path in options | ||
NOTRUN cookieStore.get with invalid url host in options | ||
FAIL cookieStore.get with empty options returns TypeError assert_unreached: Should have rejected: undefined Reached unreachable code | ||
PASS cookieStore.get with positional name | ||
PASS cookieStore.get with name in options | ||
PASS cookieStore.get with name in both positional arguments and options | ||
PASS cookieStore.get with absolute url in options | ||
PASS cookieStore.get with relative url in options | ||
FAIL cookieStore.get with invalid url path in options assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.get with invalid url host in options assert_unreached: Should have rejected: undefined Reached unreachable code | ||
|
4 changes: 1 addition & 3 deletions
4
...d/w3c/web-platform-tests/cookie-store/cookieStore_get_delete_basic.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.get returns null for a cookie deleted by cookieStore.delete' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.get returns null for a cookie deleted by cookieStore.delete promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.get returns null for a cookie deleted by cookieStore.delete | ||
|
4 changes: 1 addition & 3 deletions
4
.../w3c/web-platform-tests/cookie-store/cookieStore_get_set_across_frames.https-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.get() sees cookieStore.set() in frame' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.get() sees cookieStore.set() in frame promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'frameCookie.value')" | ||
NOTRUN cookieStore.get() in frame sees cookieStore.set() | ||
FAIL cookieStore.get() in frame sees cookieStore.set() promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'cookie.value')" | ||
|
2 changes: 0 additions & 2 deletions
2
...rted/w3c/web-platform-tests/cookie-store/cookieStore_get_set_basic.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.get returns the cookie written by cookieStore.set' specified 1 'cleanup' function, and 1 failed. | ||
|
||
PASS cookieStore.get returns the cookie written by cookieStore.set | ||
|
24 changes: 11 additions & 13 deletions
24
...rted/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
|
||
Harness Error (FAIL), message = Test named 'cookieStore.set with get result' specified 1 'cleanup' function, and 1 failed. | ||
|
||
FAIL cookieStore.set with positional name and value promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with name and value in options promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.set with positional name and value | ||
PASS cookieStore.set with name and value in options | ||
PASS cookieStore.set with empty name and an '=' in value | ||
FAIL cookieStore.set with normal name and an '=' in value promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with expires set to a future Date promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with expires set to a past Date promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with expires set to a future timestamp promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with expires set to a past timestamp promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.set with normal name and an '=' in value | ||
PASS cookieStore.set with expires set to a future Date | ||
PASS cookieStore.set with expires set to a past Date | ||
PASS cookieStore.set with expires set to a future timestamp | ||
PASS cookieStore.set with expires set to a past timestamp | ||
FAIL cookieStore.set domain starts with "." assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.set with domain that is not equal current host assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.set with domain set to the current hostname promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.set with domain set to the current hostname | ||
FAIL cookieStore.set with domain set to a subdomain of the current hostname assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.set with domain set to a non-domain-matching suffix of the current hostname assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.set default domain is null and differs from current hostname promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with path set to the current directory promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set with path set to a subdirectory of the current directory promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
PASS cookieStore.set with path set to the current directory | ||
FAIL cookieStore.set with path set to a subdirectory of the current directory assert_equals: expected null but got object "[object Object]" | ||
FAIL cookieStore.set default path is / promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set adds / to path that does not end with / promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported." | ||
FAIL cookieStore.set adds / to path that does not end with / assert_equals: expected (string) "/cookie-store/" but got (undefined) undefined | ||
FAIL cookieStore.set with path that does not start with / assert_unreached: Should have rejected: undefined Reached unreachable code | ||
FAIL cookieStore.set with get result assert_equals: expected "old-cookie-value" but got "cookie-value" | ||
|
4 changes: 2 additions & 2 deletions
4
...rted/w3c/web-platform-tests/cookie-store/cookieStore_special_names.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters