Callback tests for cookies not implemented on non-CookieMonster CookieStore implementations |
|||
Issue descriptionIn the course of investigating issue 761319 I realized that there were two problems with the current cookie implementation: * The tests for AddCallbackForCookie are only for CookieMonster, but there's an implementation of that function in both AndroidWebview and iOS. The tests should be moved to cookie store tests and any bugs fixed. * I believe (haven't checked) that the use after free bug surfaced in issue 761319 exists in AndroidWebview as well (but only for AddCallbackForCookie, which isn't surfacing this problem), so a similar fix as that for CookieMonster will need to be applied there. I think (tests aren't run, so am not sure) that iOS doesn't have the problem because it does synchronous callbacks.
,
Feb 20 2018
,
Feb 20 2018
Thanks for cc-ing me on this. I added the bug reference to https://crrev.com/c/925694
,
Feb 21 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f8cb27d6e3051319643aef24c79cd94db0b52aa1 commit f8cb27d6e3051319643aef24c79cd94db0b52aa1 Author: Victor Costan <pwnall@chromium.org> Date: Wed Feb 21 09:16:23 2018 Cookie Store: Revamp change observation tests. //net/cookies/cookie_store_unittest.h contains tests against the net::CookieStore interface, which is implemented by net::CookieMonster (in //net/cookies), android_webview::AwCookieStoreWrapper (in //android_webview/browser/net), and net::CookieStoreIOS and net::CookieStoreIOSPersistent (in //ios/net/cookies). Currently, the tests for net::CookieStore::AddCallbackForCookie() are in //net/cookies/cookie_monster_unittest.cc, so they are not run against the other net::CookieStore implementations. This is highly undesirable, as it opens up the possibility for bugs to creep into the other implementations. This CL takes the following steps to fix this situation: 1) Move AddCallbackForCookie() tests from cookie_monster_unittest.h to a new header file, cooie_store_change_unittest.h. 2) Move AddCallbackForAllChange() tests from cookie_store_unittest.h to to the same new new header file, cooie_store_change_unittest.h. 3) Harmonize test styles. 4) Sync the tests for AddCallbackForCookie() with the tests for AllCallbackForAllChanges(), so they have the same coverage. This results in new tests for both cases. 5) Add more tests covering the change filtering in AddCallbackForCookie(). 6) Fix the bugs uncovered by running the tests against AwCookieStoreWrapper. The iOS cookie store implementations will be fixed in a separate CL. Bug: 729800, 770269 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I10f0a24755a5858d2faa291ef6b855f43a880ec3 Reviewed-on: https://chromium-review.googlesource.com/925694 Reviewed-by: David Roger <droger@chromium.org> Reviewed-by: Randy Smith <rdsmith@chromium.org> Reviewed-by: Richard Coles <torne@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#538047} [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/android_webview/browser/net/aw_cookie_store_wrapper.cc [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/android_webview/browser/net/aw_cookie_store_wrapper_unittest.cc [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/ios/net/cookies/cookie_store_ios_persistent_unittest.mm [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/ios/net/cookies/cookie_store_ios_unittest.mm [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/net/BUILD.gn [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/net/cookies/cookie_monster_unittest.cc [add] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/net/cookies/cookie_store_change_unittest.h [modify] https://crrev.com/f8cb27d6e3051319643aef24c79cd94db0b52aa1/net/cookies/cookie_store_unittest.h
,
Feb 21 2018
I think I fixed this with the CL above. Please reopen if you disagree. |
|||
►
Sign in to add a comment |
|||
Comment 1 by rdsmith@chromium.org
, Feb 16 2018Owner: ----
Status: Available (was: Assigned)