0
Commit Graph

52 Commits

Author SHA1 Message Date
Ramon Cano Aparicio
6797d4e5e1 Rename HistogramBase::Sample to Sample32 in content.
Add size to type name so the size is known without needing to lookup
the typedef.
Continuation of https://chromium-review.googlesource.com/c/chromium/src/+/6163590

Changed occurrences under chromium/content

Bug: 40899968
Change-Id: I18af5c2d8d86656d0afc3a6094ab1aa5cb1b2f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6164150
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Roman Arora <romanarora@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: Ramon Cano Aparicio <rcanoaparicio@google.com>
Cr-Commit-Position: refs/heads/main@{#1404808}
2025-01-10 08:09:02 -08:00
Dave Tapuska
ef8b158db9 Fix incorrect imports of blink into content & chrome
Importing blink mojo types into other directories that aren't blink causes imports of internal blink header files (WTF::String/Vector/HashMap). This can then be abused by the caller to create structures that it shouldn't have access to. This is preliminary cleanup for adding an enforcement to the blink mojo header files.

Change-Id: I0aa1e30f07f595023191af1c96cdf58a258dc118
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5953880
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372961}
2024-10-23 21:49:38 +00:00
Luke Gu
d2d21b8467 Replace string with url.mojom.Url for url field of ScriptSourceLocation
This patch changes the url field from string to url.mojom.Url in
script_source_location.mojom.

Bug: 324031239
Change-Id: I4cf8780b8b59718bc20eb42d6e337cdc7fff3287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5358493
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274796}
2024-03-19 09:49:41 +00:00
Luke Gu
990c227b5f Reland "Replace string with url.mojom.Url for url field"
This is a reland of commit bc993a9b42

The revert crrev.com/c/5344232 doesn't seem to help with the failing
test (it's still failing:
https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm-tests/23775/blamelist), so relanding the CL.

Original change's description:
> Replace string with url.mojom.Url for url field
>
> With this patch, the use of string for url is replaced with
> url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.
>
> Bug: 324031239
> Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268274}

Bug: 324031239
Change-Id: I9945335ba1e524a086022d975c249a021a0fc9bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5346776
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269330}
2024-03-07 00:36:38 +00:00
Side Yilmaz
0f7e59a2df Revert "Replace string with url.mojom.Url for url field"
This reverts commit bc993a9b42.

Reason for revert: Cause to fail BackForwardCacheBrowserTestWithNotRestoredReasons.Reload
https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm-tests

Bug:b/328205561

Original change's description:
> Replace string with url.mojom.Url for url field
>
> With this patch, the use of string for url is replaced with
> url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.
>
> Bug: 324031239
> Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268274}

Bug: 324031239
Change-Id: I979b4f56f548bcac7bfe19870cbd8f4522e17d20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344232
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Side Yilmaz <sideyilmaz@google.com>
Commit-Queue: Side Yilmaz <sideyilmaz@google.com>
Cr-Commit-Position: refs/heads/main@{#1268391}
2024-03-05 12:52:50 +00:00
Luke Gu
bc993a9b42 Replace string with url.mojom.Url for url field
With this patch, the use of string for url is replaced with
url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.

Bug: 324031239
Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268274}
2024-03-05 06:32:27 +00:00
Kurumi Muto
0cf1280534 [bfcache] Refactor mojo structs for BFCache blockers
This CL creates a mojo struct that represents a source location. The goal is to have only two states when we manage source locations: 1. source location exists 2. no source location at all. Having a struct for source location allows us to make a source location itself nullable (avoiding having optional fields inside) and limit the possible cases to only the two.

Here are the specific changes in this CL:
- Created a new mojom file and defined a struct for source location there.
- BFCache-related structs now use the source location struct in common.

Bug: 324201881
Change-Id: I4061ad708010f895416e5881d46c16ba8a3251d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5276765
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Cr-Commit-Position: refs/heads/main@{#1263204}
2024-02-21 08:36:42 +00:00
Kurumi Muto
576c0a097c [bfcache] Change mojo struct so source location can be passed to the renderer side
This CL is to change the mojo struct `BackForwardCacheNotRestoredReasons` so it can pass source location information (i.e. url, line number, column number) to the renderer side. In a follow-up, we will send the actual source locations of reasons to the renderer's web local frame, so the NotRestoredReasons API can provide source locations.

Before this CL,
- In the mojo struct `BackForwardCacheNotRestoredReasons`, BFCache blocking reasons were represented as a vector of string without source location.
- The message is sent to the renderer side as mojo `CommitNavigationParams`'s not_restored_reasons: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/navigation/navigation_params.mojom;l=595?q=CommitNavigationParams%20-f:out&ss=chromium%2Fchromium%2Fsrc

In this CL,
- The mojo struct has fields for source location, therefore `CommitNavigationParams`'s not_restored_reasons can now contain source location information.
- But, actual source locations are not sent yet.

In follow-up CLs,
- Actual source locations gathered in back_forward_cache_impl.cc will be sent to a web local frame in the renderer.
- The NotRestoredReasons API will provide source locations.


Change-Id: I0c63b19ea3076ffa5aeb734ad87388a285961a3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5250654
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257775}
2024-02-08 04:17:32 +00:00
rubberyuzu
6211b1c826 [bfcache] Update NotRestoredReasons to match the spec draft
This CL updates NotRestoredReasons API's implementation to conform to the spec draft[1].
Namely, this CL
(1) removes "preventedBFCache" enum,
(2) adds "masked" to the outermost main frame when cross-origin iframes are blocking, and
(3) creates NotRestoredReasonDetails class on the blink side to make the reason into a struct like {"reason": "error-document"}.

As for (2), when `kAllowCrossOriginSubframes` flag is on, we add "masked" to the randomly selected cross-origin iframe.
Also with (2), `reasons` field is no longer specific to same-origin frames, so I'm moving the field out of `SameOriginDetails`.

We also need to add "masked" when UA internal reasons such as memory pressure block, and that's going to be addressed in a follow-up.

[1]: https://github.com/whatwg/html/pull/9360/files

Bug: 1472637

Change-Id: I89702696a128eea31b2dd2af0ef8c9874e7213ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5086563
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249965}
2024-01-22 02:30:48 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Fergal Daly
19b9048956 Fix flakes in PagehideAndVisibilitychangeRuns.
Expose WaitForLocalStorage in the .h file and use it in this test.

Bug: 1494646
Change-Id: I9e33f3cc22929712c465a802c110be7c1521c4af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4988389
Auto-Submit: Fergal Daly <fergal@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217409}
2023-10-31 06:04:35 +00:00
rubberyuzu
15d29d3db2 [bfcache] Save BlockingDetailsMap in CanStoreDocumentResult
This CL starts saving a map of [feature, vector of BlockingDetailsPtr] as part of CanStoreDocumentResult.
This way the information is now passed to DevTools (we already pass CanStoreDocumentResult to DevTools).

Bug:1366675

Change-Id: I3269b0d20abef3241cdc5f1a1d5ea41b613babc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4332776
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1176443}
2023-07-28 05:22:24 +00:00
Fergal Daly
97c4e59d2f Reland "Add BackForwardCacheUnloadAllowed flag."
This is a reland of commit a7387520f7

Calls to parent classes' SetUpCommandLine were missing.

Original change's description:
> Add BackForwardCacheUnloadAllowed flag.
>
> This flag controls the interaction between back/forward cache and
> unload. When it's enabled, pages with unload handlers may enter the
> cache.
>
> It is enabled by default on Android.
>
> Add/update tests to cover all scenarios.
>
> Change-Id: Ibc45486cbff6f07aa2533414f59ec8e1220772d2
> Bug: 1419856
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4293576
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Fergal Daly <fergal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1110753}

Bug: 1419856
Change-Id: Id1bf47532a44393ba559e98c34e05afea83b2d6e
Cq-Include-Trybots: luci.chromium.try:android-bfcache-rel,linux-bfcache-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4297556
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110850}
2023-02-28 10:27:33 +00:00
Jiewei Qian
0ca825b083 Revert "Add BackForwardCacheUnloadAllowed flag."
This reverts commit a7387520f7.

Reason for revert: breaking https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/44112/overview

Original change's description:
> Add BackForwardCacheUnloadAllowed flag.
>
> This flag controls the interaction between back/forward cache and
> unload. When it's enabled, pages with unload handlers may enter the
> cache.
>
> It is enabled by default on Android.
>
> Add/update tests to cover all scenarios.
>
> Change-Id: Ibc45486cbff6f07aa2533414f59ec8e1220772d2
> Bug: 1419856
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4293576
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Fergal Daly <fergal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1110753}

Bug: 1419856
Change-Id: I2c5f07cfae57865dc19c04113eccfd718b5d35f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4297455
Commit-Queue: Fergal Daly <fergal@chromium.org>
Auto-Submit: Jiewei Qian <qjw@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110788}
2023-02-28 06:28:40 +00:00
Fergal Daly
a7387520f7 Add BackForwardCacheUnloadAllowed flag.
This flag controls the interaction between back/forward cache and
unload. When it's enabled, pages with unload handlers may enter the
cache.

It is enabled by default on Android.

Add/update tests to cover all scenarios.

Change-Id: Ibc45486cbff6f07aa2533414f59ec8e1220772d2
Bug: 1419856
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4293576
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110753}
2023-02-28 04:36:25 +00:00
Fergal Daly
7e0c67bd9f BFCache: Do not check IsDOMContentLoaded of a frame if last url
in the frame is invalid

IsDOMContentLoaded can be completed when the url is valid.
If a subframe with an invalid url exists in a page, bfcache does not work because IsDOMContentLoaded of the frame is always false.

This required test updates:
- ChildFrameCaptureContentFirst disable BFCache because the test requires that the frame be evicted
- the data= version of embedded-not-found-expected.txt now passes

This adds WebContentsWaiter a base class for making test-waiters that wait for a WebContentObserver event to occur.

R=toyoshim@chromium.org

Bug: 1366707
Change-Id: I371cd9ad55f342d9c71ba24eaf5b8b5981d818ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3912822
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1107116}
2023-02-18 02:49:03 +00:00
Yuzu Saijo
aa35fc8613 Reland "[bfcache] Expose src, id and frame name for cross-origin frames"
This is a reland of commit ae786f23ec

The CL landed and got reverted because of the failure here:
https://ci.chromium.org/ui/p/chromium/builders/ci/Win%20x64%20Builder%20(dbg)/149922/overview
I tried cross-compiling with the same setup(args.gn) as the bot, but could not reproduce the error.

It seems that there's a bug around Windows machine not being able to pick up a mojom file. (crbug.com/1406792)

I will try to reland as-is.

Original change's description:
> [bfcache] Expose src, id and frame name for cross-origin frames
>
> This CL starts exposing src, id and frame for cross-origin frames for
> NotRestoredReasons API. This is for better debugging and conforms to the  explainer: https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md
>
> We send the frame tree at the time of being navigated away, and the frame attributes will help debug the page by associating the possibly modified frame tree and each frame.
>
> Bug: 1379247
> Change-Id: Ic41450d7ef9de0cb3429b644299ed8157c7ff503
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3986625
> Reviewed-by: Fergal Daly <fergal@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1091205}

Bug: 1379247
Change-Id: I2e3a6715d2d1a9c677af5947dde71554f2e73cb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4159634
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1092199}
2023-01-13 01:54:10 +00:00
Christoph Schwering
59ef13f5b3 Revert "[bfcache] Expose src, id and frame name for cross-origin frames"
This reverts commit ae786f23ec.

Reason for revert: suspect for causing compilation failure
https://ci.chromium.org/ui/p/chromium/builders/ci/Win%20x64%20Builder%20(dbg)/149922/overview

Original change's description:
> [bfcache] Expose src, id and frame name for cross-origin frames
>
> This CL starts exposing src, id and frame for cross-origin frames for
> NotRestoredReasons API. This is for better debugging and conforms to the  explainer: https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md
>
> We send the frame tree at the time of being navigated away, and the frame attributes will help debug the page by associating the possibly modified frame tree and each frame.
>
> Bug: 1379247
> Change-Id: Ic41450d7ef9de0cb3429b644299ed8157c7ff503
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3986625
> Reviewed-by: Fergal Daly <fergal@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1091205}

Bug: 1379247
Change-Id: I364046f2ab6a79b2e73100df04bd041c6eaa0fda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4154730
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Christoph Schwering <schwering@google.com>
Owners-Override: Christoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/main@{#1091219}
2023-01-11 08:51:49 +00:00
Yuzu Saijo
ae786f23ec [bfcache] Expose src, id and frame name for cross-origin frames
This CL starts exposing src, id and frame for cross-origin frames for
NotRestoredReasons API. This is for better debugging and conforms to the  explainer: https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md

We send the frame tree at the time of being navigated away, and the frame attributes will help debug the page by associating the possibly modified frame tree and each frame.

Bug: 1379247
Change-Id: Ic41450d7ef9de0cb3429b644299ed8157c7ff503
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3986625
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091205}
2023-01-11 07:45:46 +00:00
Fergal Daly
3107ca7ab6 Switch same_origin_details from pointer to optional.
This is a no-op tidy. It means we can inline the data of a tree
node instead of creating extra variables.

Change-Id: I5d186e0292cb908a3f90f2889f1d0ec589998862
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4055214
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076072}
2022-11-28 06:32:28 +00:00
Fergal Daly
25b5180000 Move not-restored-reason matchers into back_forward_cache_test.h.
This makes them accessible to all back/forward-cache tests.

Also enable the feature in the base test class.

Change-Id: Ia2462a1bbb38793a8f05940459df42b9a606f729
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4055362
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076066}
2022-11-28 06:01:24 +00:00
Yuzu Saijo
764d11af9f [bfcache] Select a random cross-origin iframe to report blocking status
This CL implements randomly selecting cross-origin iframe to report
whether or not it blocked bfcache for NotRestoredReasons API.

This is to minimize the cross-origin information leak.
Detailed design: https://docs.google.com/document/d/1NIJJik06bx5MOhRQXkqyWf5nPAp0XmQiGZlyhtZXOUY/edit#heading=h.bzbyb5fq4dud

Along with this, we are removing HasBlockingReasons() check in renderer
as well, now that we send the partially masked information and the check
cannot tell us the correct value any more.

Bug: 1384381
Change-Id: I50f8164e34131a60770cff63f52c009950c6a1fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4027464
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1072690}
2022-11-17 09:32:27 +00:00
Fergal Daly
52ba1e13e6 Add return value to WaitForInBackForwardCacheAck and [[ nodiscard ]]
Update all callers to check the return value.

This gives better behaviour in a timeout.

Bug: 1376378
Change-Id: I62625dc5130d0955124e490f01a0342e5cd0dd32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3963578
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1061459}
2022-10-20 07:53:00 +00:00
Fergal Daly
a7dcc35776 Fix flakes in BFCache tests that use large media.
The network limit is sometimes exceeded, e.g.

BackForwardCacheBrowserTestWithMediaSession.CacheWhenMediaSessionServiceIsNotUsed

plays a large video file and it might exceed the limit.

FIX: Set the limit to INT_MAX by default and only set a low limit in
tests that test the limit.

Also set the grace_period_to_finish_loading_in_seconds as it's on the same feature and it makes sense to do it (even though nothing was flaky due to this).

Bug: 1338348
Change-Id: If952526139c3179307b2743f24747e023a9522cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3956324
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1060852}
2022-10-19 03:43:18 +00:00
Daniel Cheng
ccd5b41390 Use base::test::FeatureRef for feature vectors in //content.
A base::Feature should not be copyable; a feature is intended to have a
single global instance, as it caches internal mutable state.

Feature vectors in conjunction with `base::test::ScopedFeatureList` are
by far the most common use of the base::Feature copy constructor. This
is a mostly automated replacement of `std::vector<base::Feature>` with
`std::vector<base::test::FeatureRef>` to remove that dependency.

This CL was uploaded by git cl split.

R=nasko@chromium.org

Bug: 1370572
Change-Id: Iecfb813c08c475e042234aab91577cff999b4101
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3933905
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1055143}
2022-10-05 06:20:45 +00:00
Daniel Cheng
c9ead4b363 Remove base::Feature copying from BackForwardCacheBrowsertest.
A base::Feature should not be copyable; a feature is intended to have a
single global instance, as it caches internal mutable state.

The feature copying here ends up being problematic in conjunction with
the migration to use base::test::FeatureRef for ScopedFeatureList: a
FeatureRef ends up taking a reference to a stack temporary, causing a
use-after-return.

The fix is to just pass base::test::FeatureRef all the way through; once
all feature copies are eliminated, the copy constructor will be deleted,
making future bugs of this sort harder to write.

This also cleans up some of the map-related handling: in particular,
using unnamed namespaces in headers is discouraged, since each
translation unit that includes the header ends up with its own private
copy of the functions in the unnamed namespace(s). Since this code is
not performance critical, just use std::map for simplicity.

Bug: 1370572
Change-Id: Ic1c11571c62e1c8124d6a214fc3c4a4c78968e21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3933984
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1055118}
2022-10-05 03:54:29 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Mingyu Lei
f208fa2257 Reland "Clean up enable_same_site and skip_same_site_if_unload_exists feature and the corresponding logic since we may not need to control them any more."
This is a reland of commit 43acbdc6b7

The previous commit didn't remove the flag from `testing/buildbot`,
which caused failure in `blink_web_tests`. See https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/36826/overview

In this patch, the `enable-back-forward-cache-same-site` flag is
removed:
https://chromium-review.googlesource.com/c/chromium/src/+/3865414/1..2

Original change's description:
> Clean up `enable_same_site` and `skip_same_site_if_unload_exists`
> feature and the corresponding logic since we may not need to control
> them any more.
>
> As we will assume the same-site BFCache to be always enabled
> instead of reading from the feature param, this CL removes the
> following functions and replace them with corresponding general
> BFCache checks instead:
> - `content::BackForwardCache::
> IsSameSiteBackForwardCacheFeatureEnabled()` is replaced by
> `content::BackForwardCache::IsBackForwardCacheFeatureEnabled()`.
> - `content::IsSameSiteBackForwardCacheEnabled()` is replaced by
> `content::IsBackForwardCacheEnabled()`.
>
> Similarly, as we will not blocking same site BFCache even if unload
> handler exists, the `skip_same_site_if_unload_exists` flag will be
> processed as `false` all the time. The following function is removed:
> - `content::ShouldSkipSameSiteBackForwardCacheForPageWithUnload()`.
>
> This CL also updates all the browser tests and unit tests to stop
> setting up testing context with variants in `enable_same_site`
> feature, as well as to clear all the tests against the cases when
> same-site BFCache is disabled. The testing class dedicated for the
> `skip_same_site_if_unload_exists` is also removed.
>
>
> Bug: 1353982
> Change-Id: Ib299db733fc9af35e5d35b63b1b166e1880502c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3858766
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: David Trainor <dtrainor@chromium.org>
> Reviewed-by: Michael Bai <michaelbai@chromium.org>
> Commit-Queue: Mingyu Lei <leimy@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1041643}

Bug: 1353982
Change-Id: Ibb5c67e85248e5f5a05c9602f22dc0266c5f7844
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3865414
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Taylor Bergquist <tbergquist@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1044366}
2022-09-08 04:10:49 +00:00
Taylor Bergquist
9646f4bba7 Revert "Clean up enable_same_site and skip_same_site_if_unload_exists"
This reverts commit 43acbdc6b7.

Reason for revert: blink_web_tests failing with 'AssertionError raised: enable-back-forward-cache-same-site is not defined in FlagSpecificConfig' on Ubuntu, see https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/36826/overview

Original change's description:
> Clean up `enable_same_site` and `skip_same_site_if_unload_exists`
> feature and the corresponding logic since we may not need to control
> them any more.
>
> As we will assume the same-site BFCache to be always enabled
> instead of reading from the feature param, this CL removes the
> following functions and replace them with corresponding general
> BFCache checks instead:
> - `content::BackForwardCache::
> IsSameSiteBackForwardCacheFeatureEnabled()` is replaced by
> `content::BackForwardCache::IsBackForwardCacheFeatureEnabled()`.
> - `content::IsSameSiteBackForwardCacheEnabled()` is replaced by
> `content::IsBackForwardCacheEnabled()`.
>
> Similarly, as we will not blocking same site BFCache even if unload
> handler exists, the `skip_same_site_if_unload_exists` flag will be
> processed as `false` all the time. The following function is removed:
> - `content::ShouldSkipSameSiteBackForwardCacheForPageWithUnload()`.
>
> This CL also updates all the browser tests and unit tests to stop
> setting up testing context with variants in `enable_same_site`
> feature, as well as to clear all the tests against the cases when
> same-site BFCache is disabled. The testing class dedicated for the
> `skip_same_site_if_unload_exists` is also removed.
>
>
> Bug: 1353982
> Change-Id: Ib299db733fc9af35e5d35b63b1b166e1880502c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3858766
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: David Trainor <dtrainor@chromium.org>
> Reviewed-by: Michael Bai <michaelbai@chromium.org>
> Commit-Queue: Mingyu Lei <leimy@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1041643}

Bug: 1353982
Change-Id: I0e4cf162bbc8ca0029ac91f3e4957550f7bebb01
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3868134
Owners-Override: Taylor Bergquist <tbergquist@chromium.org>
Auto-Submit: Taylor Bergquist <tbergquist@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Taylor Bergquist <tbergquist@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041777}
2022-08-31 22:31:31 +00:00
Mingyu Lei
43acbdc6b7 Clean up enable_same_site and skip_same_site_if_unload_exists
feature and the corresponding logic since we may not need to control
them any more.

As we will assume the same-site BFCache to be always enabled
instead of reading from the feature param, this CL removes the
following functions and replace them with corresponding general
BFCache checks instead:
- `content::BackForwardCache::
IsSameSiteBackForwardCacheFeatureEnabled()` is replaced by
`content::BackForwardCache::IsBackForwardCacheFeatureEnabled()`.
- `content::IsSameSiteBackForwardCacheEnabled()` is replaced by
`content::IsBackForwardCacheEnabled()`.

Similarly, as we will not blocking same site BFCache even if unload
handler exists, the `skip_same_site_if_unload_exists` flag will be
processed as `false` all the time. The following function is removed:
- `content::ShouldSkipSameSiteBackForwardCacheForPageWithUnload()`.

This CL also updates all the browser tests and unit tests to stop
setting up testing context with variants in `enable_same_site`
feature, as well as to clear all the tests against the cases when
same-site BFCache is disabled. The testing class dedicated for the
`skip_same_site_if_unload_exists` is also removed.


Bug: 1353982
Change-Id: Ib299db733fc9af35e5d35b63b1b166e1880502c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3858766
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041643}
2022-08-31 18:46:46 +00:00
Yuzu Saijo
e12e7aee84 [bfcache]Send NotRestoredReasons to renderer
This CL defines back/forward cache NotRestoredReasons struct in mojom,
populates it in browser and sends it to renderer.
This CL adds a DCHECK to ensure that this NotRestoredReasons match the
persisted boolean for pagehide.

Explainer: https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md
Bug: 1349228
Change-Id: I8c664dacb1df57e1a7fe4503779459048f10ea7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3721445
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1037571}
2022-08-22 05:56:55 +00:00
Ming-Ying Chung
a8e8a2e201 [CodeHealth] Further clean up BackForwardCacheMetricsTestMatcher
- Make impl provides `histogram_tester_`.
- Update the signature of `ukm_recorder()`.
- Move `AddSampleToBuckets()` to local.
- Add more documentation about how this class actually works.

  Bug: 1352894

Change-Id: I1835a33c06318493e498ff5e2be91f00eee21e84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3832154
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035380}
2022-08-16 06:04:50 +00:00
Ming-Ying Chung
ee9b9ea8da [CodeHealth] Extract common BackForwardCache matchers out into utils
This CL does not change any test behaviors nor modify any methods. Rather it helps reduce the size of the grand class `BackForwardCacheBrowserTest` by extracting histogram & ukm related Expect*() methods into a base class `BackForwardCacheTestMatcher`, such that other non-bfcached tests can also reuse the same logic. It also removes a dead method `ExpectTotalCount()`.

The next possible work is to not expose the private methods, and remove the complex implicit dependencies between those methods.

Change-Id: I9329819870e94716d43df4d609c16c17ca58a391
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3828394
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035000}
2022-08-15 08:24:25 +00:00
Fergal Daly
9909e09ebf Add AddBlocklistedFeature to allow testing that we block correctly.
Previously we used dedicated worker but that is about to be unblocked.
This switches to using plugin, which will never be unblocked and also
encapsulates the choice of feature so we have only one place to update
in future.

It also
- adds a main-frame test which seems to have been missing
- adds documentation on when to use this vs UseDummyStickyBackForwardCacheDisablingFeatureForTesting

Change-Id: I769e676de5f9a58d79bbe1bbb16f95d7503b1eeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3747520
Commit-Queue: Fergal Daly <fergal@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021173}
2022-07-06 14:09:34 +00:00
Matt Menke
0500b4f4a9 Make ListValueOf() return a base::Value.
It was returning a base::ListValue, which is deprecated.

Also update consumers as necessary (none of which really care much
about the ListValue vs Value difference).

Bug: 1338341
Change-Id: Icaa4f734c87177f130ed8c0a2266a940b727fd75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3727194
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1018740}
2022-06-28 17:06:58 +00:00
Fergal Daly
432aa7c06e Add ScopedVmoduleSwitches to logging.
This allows modules/levels to be added to vlog at runtime.

Use this to enable back_forward_cache_impl's vlogging in BackForwardCacheTest so that failing tests are accompanied by detailed logs.

This ends up updating the protections on g_vlog_info to prevent threads from clobbering the value when they initialize.

Change-Id: Id9a4eef496f109d2fdd07486960f76a722638de2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3648806
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013834}
2022-06-14 07:30:54 +00:00
Arthur Sonzogni
4c9cdacbe6 DanglingPtr: Mark all of them as untriaged [1/N]
This patch must be a no-op with all the common build flags.

Add the "DanglingUntriaged" raw_ptr annotation. It indicates a
raw_ptr becomes dangling, and it should be triaged/fixed.

This annotates the one firing during content_browsertests.
Multiple follow-up will complete the list, up until being able to
enable dangling pointer detection on a bot.

Stats:
- 175 DanglingUntriaged in code
- 69 DanglingUntriaged in tests

Bug=1291138

Change-Id: I00771bd46403f90297aa5b972fdd1ddc23b18e07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687960
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013525}
2022-06-13 17:22:56 +00:00
Yuzu Saijo
dcabe56a18 [bfcache] Replace NotStoredReason with NotRestoredReason
This CL replaces NotStoredReason with NotRestoredReason, and
not_stored_reason with not_restored_reasons for better code search and
consistency.

Change-Id: I6394fe6fca7586c134656edd401135563eaab72e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599899
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995594}
2022-04-25 06:06:39 +00:00
Yuzu Saijo
7b7b9a7f70 [bfcache] Remove unload support for non-Android clients
Pages with unload handlers were put into bfcache when unload strategy was
set to kAlways, but in Finch we always set this to kNo.

This CL blocks pages with unload handlers by default, and only allow them
on Android.

Bug: 1312486, 1316120
Change-Id: I80237668984ba79c90807176db67584c00df9732
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3590233
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#994048}
2022-04-20 05:12:08 +00:00
Takashi Toyoshima
e40aa1e913 BFCache: Do not store if FencedFrames are in use
As MPArch doesn't support storing FencedFrames embedder pages into
the back-forward cache now, this patch makes the back-forward cache
deny storing such pages into the cache.

Bug: 1301880, 1251387, 1310665
Change-Id: I7912422e23efc56809ba6ce36aea637d5a342710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3529089
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Auto-Submit: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986899}
2022-03-30 08:32:16 +00:00
Yuzu Saijo
c347807bb5 [bfcache] Use NotRestoredReasonBuilder to add eviction reasons
This CL uses the new class to iterate thru the frame tree to check
bfcache eligibility, in order to correctly capture eviction reasons.
Now NotRestoredReason tree is only created through the builder.

This also adds test cases to make sure eviction reasons are recorded.

Bug: 1297914
Change-Id: I727da918ff4c71152554d0af598fa25fd2457b42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3467300
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984701}
2022-03-24 06:15:26 +00:00
Fergal Daly
7a05b426c6 Use IsErrorDocument() to prevent BFCacheing of interstitials and errors.
In the bug, a crash occurs because we try to cache an interstitial. We
catch some error documents via status codes etc but interstitials do
not consistently set those. Checking IsErrorDocument() is more reliable.

Bug: 1274308,1287996
Change-Id: Ifec662c169c77e33ca5dc4d56b0e42c8d71f1d97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3319862
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#981026}
2022-03-15 09:18:40 +00:00
Fergal Daly
47ca7236d4 Remove unused check_eligibility_after_pagehide_.
Change-Id: I8fe6cdd2a4dadeee70f1e344094e4c0a83c6e090
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3488325
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#975080}
2022-02-25 12:16:31 +00:00
Fergal Daly
c4d8b18263 Make WaitForDOMContentLoaded return a bool and use [[nodiscard]].
Update all call sites.

This ensures that if the runloop exits due to test timeout we get a failure at the correct location in the code.

Change-Id: Icef5b2cb1c93130e42b8eda30227f068039c2a17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3447667
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#970511}
2022-02-14 08:00:27 +00:00
Fergal Daly
2c7bc405c3 Introduce GetLocalStorage helper and refactor tests to use it.
Bug: 1280530
Change-Id: Ifc7b4fdfa8611910c88137692a4f51d88af900e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3353639
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#953834}
2021-12-23 14:42:22 +00:00
Yuzu Saijo
6ff6d5010d [bfcache] Enable network request per-process experiment by default
This CL enables the experiment to only consider per-process network
request buffer limit by default.
The experiment has been running on stable 50% and the results look good,
and now we are proceeding to advance it to stable 100% via finch.

But before that we need to enable it on TOT.

Also this CL removes browser tests that use per-request limit, which will
be no longer used after enabling the feature.

Bug: 1243600
Change-Id: Id65d6554a1c8ec9f087916dc03cc8a4fc3529e85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3337833
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#952362}
2021-12-16 15:04:05 +00:00
Hajime Hoshi
a12414a521 BackForwardCache: Reenable tests of back-fowrad cache w/ dedicated workers
This CL fixes the flakiness issue in
FetchStillLoading_ResponseStartedWhileFrozen_ExceedsPerRequestBytesLimit,
by waiting for the renderer's freezing.

Bug: 1275106
Change-Id: I75ddcce3317278e706c23a02ec566771a5d9ade0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3320663
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#949425}
2021-12-08 08:21:23 +00:00
Fergal Daly
973dc9e0d6 Extract back_forward_cache_internal_browsertest.cc.
Tests for internals of BFCache or that rely on internals.


Bug: 1267091
Change-Id: Ifcf71e7fe58e279e1df870caf813d1314ed6cc59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3291199
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943455}
2021-11-19 09:38:17 +00:00
Fergal Daly
5495b0ea4d Introduce history traversal helpers to GoBack etc and wait.
This makes tests a bit clearer and more concise but I have also seen 2
tests in the last 2 days that incorrectly omitted the WaitForLoadStop.

This updates all of BFCache's tests to use these. It also changes all
EXPECTs to ASSERTs because continuing after the history traversal fails
is almost certainly going to generate noise, not signal.

Change-Id: I61d6f0797f4e6bc52f927bc83cccc2361fd045f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288729
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943378}
2021-11-19 02:03:28 +00:00
Fergal Daly
43b198f386 Move bluetooth code out of BackForwardCacheBrowserTest into subclass.
Bluetooth is only used by one test but ends up getting compiled in for
all groups of tests. This will reduce include size and compile time a
little for those.

Bug: 1267091
Change-Id: I8f96c4b1632559983cc41614cd99f29daa742854
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3269792
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940194}
2021-11-10 05:14:11 +00:00