Giovanni Ortuño Urquidi
e0a77b4a35
btm: Introduce CookieAccessInterceptor to test delayed cookie accesses
...
Because of how there's no ordering guarantee between messages from
different Mojo pipes, cookie access notifications (those delivered
through network::mojom::CookieAccessObservers), can arrive at different
points during a navigation/page lifecycle.
For example, if a response has a `Set-Cookie` header, a notification for
the cookie access could arrive, (1) before the page commits, (2) after
the page commits, or (3) after the page is closed.
Features that act on cookie notifications are resilient to different
notification timing, but they currently have no way to accurately test
each case.
This CL makes two related changes to allow features to control when
cookie access notifications arrive:
1. Put CookieAccessObservers in its own file so it can be used by other
classes and changes NavigationRequest to use it. Also add a
SetCookieAccessObserversForTesting() method to NavigationRequest so that
it can be replaced in tests.
2. Adds a ControllableCookieAccessObservers test class which subclasses
CookieAccessObserver. Tests can use this class' Pause() method to delay
the delivery of cookie access notifications. This is done by *not*
binding CookieAccessObserver receivers, essentially pausing any
notifications.
At the moment, this only works for navigational cookie access. Once the
navigation commits, the pending receivers will be transferred to the
RenderFrameHostImpl and the notifications will be dispatched. A follow
up CL will allow tests to pause notifications for frame accesses and
transfer the paused state from navigations to frames.
Bug: 394059601
Change-Id: Ide87045c7b4410cb88264491dd86faf051da78fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6368317
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org >
Reviewed-by: Ryan Tarpine <rtarpine@chromium.org >
Reviewed-by: Rakina Zata Amni <rakina@chromium.org >
Cr-Commit-Position: refs/heads/main@{#1439392}
2025-03-28 07:31:35 -07:00
..
2025-03-28 07:10:47 -07:00
2025-03-24 15:16:25 -07:00
2025-03-24 21:23:22 -07:00
2025-03-24 06:15:39 -07:00
2025-03-25 12:27:03 -07:00
2025-01-29 22:48:50 -08:00
2025-03-06 11:41:24 -08:00
2025-01-28 18:11:08 -08:00
2025-03-24 10:29:10 -07:00
2025-03-06 20:13:23 -08:00
2025-03-28 06:24:47 -07:00
2025-03-18 13:08:02 -07:00
2025-03-28 07:31:35 -07:00
2025-03-18 11:39:36 -07:00
2025-03-27 08:23:05 -07:00
2025-03-11 10:18:31 -07:00
2025-03-27 17:31:28 -07:00
2025-03-11 10:18:31 -07:00
2025-03-20 09:05:16 -07:00
2025-03-01 06:52:18 -08:00
2025-01-23 09:37:59 -08:00
2024-12-17 14:41:45 -08:00
2025-03-13 09:03:11 -07:00
2025-03-17 08:34:53 -07:00
2025-03-27 20:25:55 -07:00
2025-03-18 12:51:48 -07:00
2025-02-04 04:26:46 -08:00
2025-03-25 06:20:47 -07:00
2025-03-27 18:31:41 -07:00
2025-03-27 07:23:11 -07:00
2025-03-17 19:30:47 -07:00
2025-03-18 12:51:48 -07:00
2025-03-28 06:24:47 -07:00
2025-03-19 08:31:42 -07:00
2025-03-11 10:51:10 -07:00
2025-02-25 01:40:15 -08:00
2025-01-31 12:40:46 -08:00
2025-02-19 21:03:02 -08:00
2025-03-25 10:08:13 -07:00
2024-12-16 18:02:08 -08:00
2025-02-14 15:33:13 -08:00
2025-01-27 17:14:08 -08:00
2025-02-14 01:34:27 -08:00
2024-12-10 20:41:54 +00:00
2025-03-19 12:47:33 -07:00
2025-03-27 10:42:16 -07:00
2025-03-27 13:50:08 -07:00
2025-03-07 13:15:29 -08:00
2025-03-27 18:31:41 -07:00
2025-03-18 12:51:48 -07:00
2025-03-07 15:02:55 -08:00
2025-03-26 22:53:52 -07:00
2024-12-12 17:51:18 -08:00
2025-03-26 08:07:15 -07:00
2025-02-20 12:50:27 -08:00
2025-03-04 13:05:49 -08:00
2025-03-24 10:07:45 -07:00
2024-12-18 15:55:07 -08:00
2025-03-01 17:13:12 -08:00
2025-03-12 14:59:57 -07:00
2025-03-07 08:10:47 -08:00
2025-03-28 06:22:58 -07:00
2024-12-10 20:41:54 +00:00
2025-03-18 12:51:48 -07:00
2025-03-12 05:48:04 -07:00
2024-12-10 20:41:54 +00:00
2025-03-18 11:39:36 -07:00
2025-03-17 10:08:24 -07:00
2025-03-28 07:31:35 -07:00
2025-03-27 16:49:08 -07:00
2025-03-27 16:58:44 -07:00
2025-01-27 17:14:08 -08:00
2025-02-12 13:46:54 -08:00
2024-12-16 18:02:08 -08:00
2025-03-27 22:35:10 -07:00
2025-02-14 15:33:13 -08:00
2025-03-18 12:51:48 -07:00
2025-03-27 23:36:17 -07:00
2025-01-28 18:11:08 -08:00
2025-03-27 19:02:09 -07:00
2025-03-14 04:28:35 -07:00
2025-02-19 07:36:17 -08:00
2025-03-12 11:35:54 -07:00
2025-03-14 10:51:25 -07:00
2025-03-25 06:20:47 -07:00
2025-03-18 12:51:48 -07:00
2025-03-27 16:49:08 -07:00
2025-01-31 12:40:46 -08:00
2025-03-27 10:21:52 -07:00
2025-02-28 11:05:45 -08:00
2025-03-27 18:26:28 -07:00
2025-03-21 11:37:39 -07:00
2025-03-28 00:46:28 -07:00
2025-03-14 10:53:12 -07:00
2025-03-27 16:49:08 -07:00
2025-03-26 16:49:32 -07:00
2025-02-20 13:41:00 -08:00
2025-01-28 18:11:08 -08:00
2025-03-13 08:47:02 -07:00
2025-03-16 20:55:33 -07:00
2025-03-18 12:51:13 -07:00
2025-03-18 12:51:48 -07:00
2025-03-24 11:13:57 -07:00
2025-02-20 08:00:14 -08:00
2025-01-10 08:09:02 -08:00
2025-03-24 10:07:45 -07:00
2025-03-18 07:51:59 -07:00
2024-12-20 09:41:03 -08:00
2025-03-11 04:30:59 -07:00
2025-03-10 00:24:01 -07:00
2025-03-28 02:49:40 -07:00
2025-02-02 23:01:07 -08:00
2025-03-07 13:15:29 -08:00
2024-12-10 20:42:14 +00:00
2025-03-26 22:53:52 -07:00
2025-01-07 09:12:57 -08:00
2025-01-23 09:19:53 -08:00
2025-01-23 09:19:53 -08:00
2025-02-24 10:37:05 -08:00
2025-02-28 12:29:34 -08:00
2025-02-28 12:29:34 -08:00
2025-03-27 17:23:22 -07:00
2025-03-05 15:21:22 -08:00
2025-01-17 08:15:02 -08:00
2025-03-25 07:41:47 -07:00
2025-02-24 12:29:36 -08:00
2025-01-09 08:51:48 -08:00
2025-02-24 10:37:05 -08:00
2025-03-11 10:18:31 -07:00
2025-02-20 09:07:44 -08:00
2025-01-27 17:14:08 -08:00
2024-11-13 00:52:22 +00:00
2025-02-11 09:56:54 -08:00
2025-03-28 07:31:35 -07:00
2025-03-11 10:18:31 -07:00
2024-12-16 18:02:08 -08:00
2025-02-20 13:41:00 -08:00
2025-02-13 10:10:56 -08:00
2025-01-31 16:09:37 -08:00
2025-03-18 12:51:13 -07:00
2025-03-18 12:51:48 -07:00
2025-03-07 07:05:09 -08:00
2025-01-23 09:19:53 -08:00
2025-01-31 16:09:37 -08:00
2025-02-24 17:14:59 -08:00
2025-03-18 12:51:48 -07:00
2025-01-07 09:12:57 -08:00
2024-11-20 19:58:42 +00:00
2025-01-27 17:14:08 -08:00
2024-11-06 02:09:07 +00:00
2025-02-11 09:56:54 -08:00
2025-02-07 15:21:43 -08:00
2025-02-07 15:21:43 -08:00
2025-02-06 04:16:57 -08:00
2025-01-23 19:11:04 -08:00
2024-12-10 20:41:54 +00:00
2025-03-20 14:57:27 -07:00
2025-03-11 10:51:10 -07:00
2024-12-15 21:15:36 -08:00
2025-01-27 17:14:08 -08:00
2025-03-11 00:10:31 -07:00
2025-03-14 12:26:55 -07:00
2025-01-13 14:09:43 -08:00
2025-01-13 14:09:43 -08:00
2024-12-13 05:35:28 -08:00
2025-03-13 08:36:19 -07:00
2025-03-13 08:36:19 -07:00
2025-03-21 12:40:12 -07:00
2025-03-21 12:40:12 -07:00
2025-02-11 09:56:54 -08:00
2025-01-28 18:11:08 -08:00
2024-12-16 07:45:14 -08:00
2024-12-16 18:02:08 -08:00
2025-02-24 10:37:05 -08:00
2025-03-27 07:23:11 -07:00
2024-12-03 01:12:55 +00:00
2025-01-28 18:11:08 -08:00
2025-01-16 09:49:10 -08:00
2025-03-07 09:02:29 -08:00
2025-03-07 09:02:29 -08:00
2025-03-24 11:08:50 -07:00
2025-03-24 11:08:50 -07:00
2025-03-12 03:32:51 -07:00
2025-03-24 10:07:45 -07:00
2025-02-24 10:37:05 -08:00
2024-12-12 17:51:18 -08:00
2025-01-27 17:14:08 -08:00
2024-12-16 18:02:08 -08:00
2025-01-27 17:14:08 -08:00
2025-02-24 10:37:05 -08:00
2025-01-31 16:09:37 -08:00
2025-01-31 16:09:37 -08:00
2025-01-31 16:09:37 -08:00
2025-01-07 09:12:57 -08:00
2024-12-27 20:15:58 -08:00
2025-01-07 09:12:57 -08:00
2025-01-31 12:40:46 -08:00
2024-12-16 18:02:08 -08:00
2025-01-27 17:14:08 -08:00
2025-03-03 15:35:50 -08:00
2025-01-29 22:48:50 -08:00
2025-02-11 09:56:54 -08:00
2025-03-02 22:46:39 -08:00
2025-02-12 19:21:36 -08:00
2025-03-19 15:03:45 -07:00
2025-03-24 06:15:39 -07:00
2025-01-28 18:20:30 -08:00
2025-01-28 18:20:30 -08:00
2025-03-03 14:15:03 -08:00
2025-01-27 17:14:08 -08:00
2024-12-16 18:02:08 -08:00
2025-03-24 11:08:50 -07:00
2025-03-24 11:08:50 -07:00
2025-03-24 11:08:50 -07:00
2024-12-10 20:41:54 +00:00
2025-03-13 08:47:02 -07:00
2025-03-13 08:47:02 -07:00
2025-03-28 01:31:22 -07:00
2025-02-24 13:51:47 -08:00
2024-12-10 01:13:01 +00:00
2024-12-10 01:13:01 +00:00
2025-03-10 07:46:59 -07:00
2025-01-23 03:48:54 -08:00
2025-03-18 12:51:48 -07:00
2025-03-18 12:51:48 -07:00
2024-12-10 01:13:01 +00:00
2024-12-10 01:13:01 +00:00
2025-02-18 07:51:15 -08:00