0
Commit Graph

583 Commits

Author SHA1 Message Date
41c119a54a Fix AcrossTasksDangling in select_file_dialog.h
Overriding classes need to reset `listener_` to nullptr on
`ListenerDestroyed()` calls to avoid holding a dangling ptr.

Change-Id: I16bed9d1b14d86394bf206ef2e17bdf4306d21cc
Bug: 1474236
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4794134
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1190276}
2023-08-30 19:48:26 +00:00
0a6d4b5069 [PEPC] Add new structs to contain permission request data
This CL adds new struct PermissionRequestDescription and
PermissionRequestData that groups all information we will need to make
a permission request to permission infrastructure.
This is one in a series of CLs implementing the design:
https://docs.google.com/document/d/1a1gjlJ4VkAWoG8AeGKZDcQXm_c0q-cFTs_5MxmjWVYI/edit, next step is to parse the fields within the structs handle permission request from <permission> element properly.

Bug: 1271543,1462930
Change-Id: I4a7b64149bc3323075f802f832766aa2211455fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4756727
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1189522}
2023-08-29 15:13:09 +00:00
4d8331c2cf [RenderDocument] Flush synthetic events before web test start
Enabling RenderDocument causes same-origin navigations to swap to a new
RenderFrameHost. However, when a RenderFrameHost is changed, the browser
dispatches synthetic mouse events to ensure the renderer knows where the
mouse cursor is. In web tests using the event_sender API, events are
injected into Blink synchronously so the browser-generated synthetic
events may be processed after test events which can affect test output.

This CL changes the web test runner to ensure all synthetic events have
been flushed and processed before the test is started. It does this by
blocking parsing in a web test until input has been flushed, the order
of events from the perspective of WebTestControlHost:

  * Initial-state/Test Finished: Set a `next_nav_is_new_test` bit.
  * READY_TO_COMMIT: If `next_nav_is_new_test` - call
    BlockTestUntilStart in the renderer which blocks parsing in the
    current DocumentLoader, before it starts loading the new document.
  * <During CommitPending>: Post a task to generate the synthetic
    events.
  * DID_FINISH_NAVIGATION: If `next_nav_is_new_test` - clear the bit and
    post a task to:
      * Flush input - this waits until all input has been IPC'd to the
        renderer and ACK'd. Note: input may still be queued in
        renderer-side compositor or main thread queues.
      * Calls StartTest on the renderer.
  * StartTest (in renderer)
    * Flushes the compositor queue to ensure all its input has been
      processed (this may result in queueing input on the main thread).
    * Flushes the main thread event queue.
    * Unblocks the parser.

Bug: 1416496
Change-Id: I2ac0c3745e74a0a01055d5e7a474036096b8ec6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4727485
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1188325}
2023-08-25 14:23:09 +00:00
eac566b060 Move foundation_util to base/apple, leave a forwarding header
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.

Skipping trybots. This is a Mac change, and it’s passing all
trybots except for android_optional_gpu_tests_rel that is
repeatedly failing on an unrelated issue.

NOTRY=true

Bug: 1444927
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Change-Id: Iad0c903187b0e1e5584c68f2eb00b5b026085596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790744
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185029}
2023-08-18 02:56:21 +00:00
4b36fa15bd [FedCM] Fix re-auth when 3pc are disabled but the ISS OT is enabled
The API permission status check in OnAccountSelected did not
take the origin trial into account.

In order to write a valid test for this case, I had to make content_shell
tell the federated permission context when third party cookies are
disabled. This follows a suggestion from morlovich@ through:
https://groups.google.com/a/chromium.org/g/net-dev/c/fZU_IK_BITI/

Bug: 1472928
Change-Id: I32d5757db883c34d025969a3fab943dfcddcae58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4784810
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Reviewed-by: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185005}
2023-08-18 01:43:07 +00:00
47c2f9b983 Transition to "Menlo" monospace font on Mac
We are using "Courier" as a default monospace font on Mac. Other
browsers, like FF and Safari are using "Menlo" font.

"Menlo" has a better glyph coverage compared to "Courier". It has glyphs
for box-drawing unicode characters and for cyrillic script while
"Courier" does not have them. It also has better glyph attachments
stacking for zalgo text [0].

Changed font sizes in web_tests/external/wpt/css/css-display/display-contents-shadow-dom-1.html and web_tests/external/wpt/css/css-multicol/multicol-width-ch-001.xht due to the pixel differences in glyphs' positions after the change. It was happening because of the rounding of glyphs positions' value (presumably because wpt tests are running without antialiasing and subpixel positioning), see https://bugs.chromium.org/p/chromium/issues/detail?id=1409445. "Menlo" has different advances from "Courier" that's why we wasn't facing this issue before. Changed tests are testing different logic and font size is not affecting that.

[0] https://en.wikipedia.org/wiki/Zalgo_text

Bug: 1449469
Change-Id: I53c94e5b2c9089c05874dff33750e281d1c4ad88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4700963
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Munira Tursunova <moonira@google.com>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184059}
2023-08-16 09:50:33 +00:00
627d7463c7 Delete --disable-threaded-scrolling.
Bug: 1087725,1369739
Change-Id: I62d8034196233c6441573ee92a30d9b23ac243d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770462
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1183938}
2023-08-16 01:02:05 +00:00
d848960ba7 Refactor WebsocketHandshakeThrottle API to pass in SecurityOrigin
The SecurityOrigin object will be used to determine if a request
originated from an extension.

Bug: 1447587
Change-Id: I8328a79c657c4f08f59cc4d05bf5a95f766e111d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706025
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Commit-Queue: Richard Chen <richche@google.com>
Cr-Commit-Position: refs/heads/main@{#1183271}
2023-08-14 19:47:59 +00:00
e4afdf8dfb [FedCM] Support a new dialog type for the IDP signin confirmation
Also supports closing that dialog through dismissDialog

Bug: 1451884
Change-Id: If1d33837562cf5e28bf33d4a78a2091e506a6840
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4740672
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1182269}
2023-08-10 20:31:51 +00:00
dd025db169 Remove the auto-resolve cases from requestStorageAccess()
Specifically the same-site case and top-level frame case, so that
requestStorageAccess() does not auto-resolve before checking user
settings.

A spec PR will be created for this change. Normally we don't change
things before PRs land, but in this case we're forced to by the branch
cut deadline.

Bug: 1441133, 1471209
Change-Id: I4165dd54c0d4d9e4130946dcca3f1c668b6265e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706928
Reviewed-by: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Commit-Queue: Shuran Huang <shuuran@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1181612}
2023-08-09 18:38:10 +00:00
a475f4a3c1 SAA: Query for embargoed StorageAccess permissions
Ensure that embargoed permissions are correctly displayed by querying
for the embedder and requester origin of blocked permissions.
The main change is page_info.cc and chrome_page_info_delegate.cc.
Everything else is adding a second parameter to a PermissionManager
function that is implemented a dozen times.

Bug: 1433644
Change-Id: Ib75b4cc0785764bee9f1c68998233cc62e65e2f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4746465
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1180362}
2023-08-07 17:04:13 +00:00
f8e6484106 Do not reset before running web tests
It could override settings that are already initialized using default initializer. Besides, ResetBrowserAfterWebTest() is already called at
the end of running each test.

Historically this call existed because it also initializes some
settings, however, going over each of the calls the defaults are
maintained and behavior such as WebTestResultPrinter is dependent on
test state. (Which will be no-ops during the removed call.)

Change-Id: I3dffecdaf62ed0183b92e221bbe16ed6216286e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4753395
Commit-Queue: Shuran Huang <shuuran@chromium.org>
Auto-Submit: Shuran Huang <shuuran@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1180330}
2023-08-07 15:58:29 +00:00
db03348418 Use threaded compositing by default in web_tests runner
Bug: 1463799
Change-Id: I4c930ce980cbd5f3960cf8e5a364a7ef363fb01b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4736695
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1179238}
2023-08-03 20:40:18 +00:00
979c6bd558 [FedCM] Tentatively fix flakiness in fedcm-iframe test
The cancelHelper is not scoped accurately. Additionally, use a WeakPtr
for the RFH in case a test accidentally invokes the function after the
RFH is destroyed, to avoid UAF.

Bug: 1404951
Change-Id: I67c2259692b90a936cfeb3e268b839e1912879af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4742921
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1178618}
2023-08-02 20:03:58 +00:00
9bf75c5e9a Remove ARC boilerplate in /content
ARC is now enabled by default, so there’s no need to enforce it
against files being put into non-ARC targets.

Bug: 1468376
Change-Id: If25307bfbea5a1df8937b433dde5fa83871cff74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4738888
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1178112}
2023-08-01 22:39:26 +00:00
5cb9b71810 Make room for page margins in web tests.
With CL:4725066, page size calculation is done inside Blink, rather than
in PrintRenderFrameHelper & co. This makes it much easier to support web
tests properly, since we don't use PrintRenderFrameHelper in such cases
(and would otherwise have to duplicate its logic). For now, add support
for page margins. Later on, mixed page sizes will just work
out-of-the-box, once support for that has been added to the layout code
(upcoming CL).

Bug: 835358
Change-Id: Ic2b8b891b692d99f4d2d030a907399338abc96be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4727864
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177906}
2023-08-01 17:09:52 +00:00
d87851b1ce [content] Use base::Contains() in more components of //content
The modification of this patch involves //content/shell,
//content/test, //content/web_test, //content/zygote

Bug: 561800
Change-Id: I00b1388d34810033253d68193684482c4324fc95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4729188
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177203}
2023-07-31 13:09:56 +00:00
548c256ca8 Reset aggregation service data between web tests
Currently, certain Private Aggregation tests are flaky as reports from
a different test are sometimes delayed and sent in a different test.

Bug: 1456739
Change-Id: Ibc41bb75037877169f6fb9949dc2540be120b197
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706044
Commit-Queue: Alex Turner <alexmt@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1176647}
2023-07-28 16:08:47 +00:00
88b96c0bea Run web tests with WebPreferences::threaded_scrolling_enabled = true.
This pref was linked to threaded compositing in crrev.com/821456 but it
doesn't need to be anymore.

Also remove calls to internals.settings.setThreadedScrollingEnabled()
in web tests that check main-thread scrolling reasons.

Bug: 1087725,1369739
Change-Id: I59b528b542d776fd591fe08e46790fb5f5fde9d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4721697
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1176076}
2023-07-27 15:34:44 +00:00
6d838570d8 Remove redundant ARC configuration in /content
ARC is now enabled by default, so enabling it at the target level is
redundant and can be removed.

Bug: 1280317
Change-Id: I1e45db928efa23d02d1a135b09e776d2db227b7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4720672
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1175573}
2023-07-26 18:44:07 +00:00
2e0b586e92 Use SafeRef for BFCache restoration's RFH
In crrev.com/c/4401995 and crrev.com/c/4634965 we ensure that the
BFCache NavigationRequest will never outlive the speculative RFH.
So the `rfh_restored_from_back_forward_cache_` should never be
invalidated once set.

This CL changes the type of `rfh_restored_from_back_forward_cache_`
from WeakPtr to optional<SafeRef>, so the caller can claim that it's
either null since the construction, or is currently referencing to a
valid RFH.

Bug: 1430653
Change-Id: Ic9b4513248fbbda03108d49e2c5ebd55955f3f92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4707476
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1174960}
2023-07-25 18:26:00 +00:00
17e52a99ef [LCPP] Read-path test: ElementLocator matching <img>s priority bumed to VeryHigh
This CL adds a test case for the read path added in https://crrev.com/c/4672510

The test html is
third_party/blink/web_tests/http/tests/lcp_critical_path_predictor/prioritize_lcp_image.php
, but it requires the following test infra changes to run:
- NonAssociatedWebTestControlHost mojom binding so it can be accessed
  from mojo JS binding. Context: discussion at
  https://chromium.slack.com/archives/CGGGVPSQ4/p1688601297545099
- WebTestContentBrowserClient injects LCPP hint at
  `DidStartNavigation` if it was supplied via
  NonAssociatedWebTestControlHost.
- BUILD.gn files are modified so that they will generate
  wire format protos used for testing from text protos.
- `lcpp` VirtualTestSuite is added, since the test require the
  LCPCriticalPathPredictor feature flag to be enabled until the
  feature is unflagged.

Bug: 1419756
Change-Id: Ib7447341808d2df4e5ca374c42362e872c11b1f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4673124
Auto-Submit: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1174559}
2023-07-25 00:30:36 +00:00
a456093028 LoAF: Don't expose script URLs outside of HTTP(s)/blob/data
Bug: 1465215
Change-Id: I891343879031f7f0abb0ab0be3982a192a87905e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4687061
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1172973}
2023-07-20 15:16:28 +00:00
556424961b Implement support for multiple IDREFs in aria-errormessage
Supported starting in WAI-ARIA 1.3.
https://github.com/w3c/aria/pull/1802

Bug: 1403266
Change-Id: I5e3892e798f78acb8d99ff89d5bba76e12a9e2f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4604466
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Anastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/main@{#1172297}
2023-07-19 12:14:49 +00:00
e6361d070b Rename DanglingAcrossTasks to AcrossTasksDanglingUntriaged
Following up on https://chromium-review.googlesource.com/c/chromium/src/+/4567353/comments/67bd2f0d_b10f9056
Add back DanglingUntriaged into the name of this trait.
Keep the name consistent with other traits.

Change-Id: I2702f843d9e81b87656ca31fd4c9ba19943d44d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4675808
Commit-Queue: Pâris Meuleman <pmeuleman@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1172247}
2023-07-19 09:00:43 +00:00
5f3cc0a81d [fuchsia][scenic] remove fuchsia.ui.scenic/UsesFlatland dependencies
This is no longer needed now that we don't need fuchsia.ui.scenic to tell us the state of `UsesFlatland` (always default to true).

Bug: 1427170
Bug: fuchsia:100303
Fixed: 1418433
Change-Id: I7f351c0369307144219bfec97baa324b1b6d6442
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4685188
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Caroline Liu <carolineliu@google.com>
Cr-Commit-Position: refs/heads/main@{#1171961}
2023-07-18 20:48:38 +00:00
f27b1576e4 [A11y] Remove obsolete Event::kAriaAttributeChanged
Downstream APIs should not need to know whether a change is from ARIA or native markup. This is a code cleanup only -- not behavior changes.

Bug: none
Change-Id: I3578dc5ab04bc2f01c1bbe0a520ca5811246593e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4500419
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1171731}
2023-07-18 14:20:35 +00:00
79d2a31660 [execCommand] Support modifier+non-modifier in KeyUp/keyDown
This patch supports sending keys with modifiers in `keyUp` and
`keyDown` action sequences.

crrev.com/c/4654141 supported `keyUp` and `keyDown` for all
keys, but when they are combined, such as:
```
actions().keyDown(kAltKey)
         .keyDown('c')
         .keyUp('c')
         .keyUp('kAltKey)
         .send();
```
It's the keyboard driver's (`EventSender` in this case)
responsibility to keep track of the modifier key state, not
the `Widget`'s (which `EventSender` sends events to.)

This patch updates `EventSender` to keep track of the state.

This patch:
* Fixes 3 tests (6 sub tests.)
* Makes a WIP test in crrev.com/c/4679415 pass.
* Turns 1 timeout to a failure. The cause isn't clear but the
  test fails at wpt too:
https://wpt.fyi/results/uievents/interface?label=master&label=experimental&aligned&q=keyboard-accesskey-click-event

Bug: 893480, 1462196
Change-Id: If1cf6e0a290c9f060135b2a67322aed3dd559e5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4680842
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1170356}
2023-07-14 06:24:07 +00:00
92f0fb71ad Revert "[Local Network Access] Rename 'private' to 'local' in ip_address_space_util"
This reverts commit d5b320062c.

Reason for revert: The spec has been renamed back to Private Network Access https://github.com/WICG/private-network-access/pull/106

Original change's description:
> [Local Network Access] Rename 'private' to 'local' in ip_address_space_util
>
> In https://github.com/WICG/local-network-access/issues/91, we decided to
> rename (public, private, local) IP address spaces to (public, local,
> loopback). The spec has already been renamed in
> https://github.com/WICG/local-network-access/pull/97.
> New spec:
> https://wicg.github.io/local-network-access/#ip-address-space-heading
>
> This CL renames the occurrences in ip_address_space_util{_unittest}.cc.
> It also updates the IPAddressSpaceToStringPiece method so it updates
> places that uses it too, including the kIpAddressSpaceOverrides switch
> values.
>
> There are so many places to rename, so during the process, there will
> inevitably be inconsistencies. Hopefully, we shall resolve all of them
> soon.
>
> Bug: 1418287
> Change-Id: I30a93f41488f28b7269183a2bb627c11c2d29c1a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4315887
> Commit-Queue: Jonathan Hao <phao@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1114582}

Bug: 1418287
Change-Id: I7538621b445674ae12d81bfe123dbcf67ef5a8ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4675802
Reviewed-by: Colin Blundell <blundell@chromium.org>
Auto-Submit: Jonathan Hao <phao@chromium.org>
Commit-Queue: Jonathan Hao <phao@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1168787}
2023-07-11 17:03:43 +00:00
1c3bf179c5 [execCommand] Support keyUp() and keyDown() in action sequences
This patch implements a short-term solution for `keyUp()` and
`keyDown()` in action sequences. As in crbug.com/893480, the
long-term solution is to move to webdriver, but some tests
need to be fixed before the long-term solution.

This patch does this by following changes:
1. The `testdriver-vendor.js` determines whether it's a key
   actions or pointer actions, and dispatch key actions to
   `EventSender` instead of `gpuBenchmarking`.
   `EventSender` already has logic necessary to implement this,
   and it's already used for `send_keys()` testdriver function.
   This patch shares the logic with it.
2. `EventSender` has two new functions: `KeyDownOnly` and
   `KeyUp`, to support `keyDown()` and `keyUp()` actions
   respectively.
   Note, `EventSender::KeyDown()` already exists, which sends
   both key-down and key-up events. This is currently used by
   hundreds of tests, hence the naming above avoids conflicts.

One limitation in this short-term solution is that one action
sequence can't contain both key and pointer actions. From the
test result, there is one such test. Such test is still not
testable with this patch, but this patch turns 43 untestable
tests to testable.

Bug: 893480, 1420675
Change-Id: I6a17b46caefdeb13245bfecb1eb9bd0f28550f7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4654141
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#1167771}
2023-07-08 12:56:47 +00:00
9c0ef1515d Switch to the span version of CommandLine::CopySwitchesFrom() in content
Use the span version of CopySwitchesFrom() to simplify the callers.
Along the way, make some switches constants truly const and fix a sign
issue in ui/gl/gl_switches.h that prevents a span construction from
working.

Bug: 1462705
Change-Id: Icccd16c942ea34810d8ca9be5d9d104a9e91412f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4673623
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1167650}
2023-07-07 21:42:59 +00:00
508dce9dea Annotate all Across tasks dangling raw_ptrs
This follows up on https://crrev.com/c/4567353 and annotates all
raw_ptrs that were detected as dangling across tasks on the CQ in the
following CL https://crrev.com/c/4166936.

Change-Id: I8ac81276b72c315d7624008cf7421a419b7786ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4650611
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Pâris Meuleman <pmeuleman@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1164246}
2023-06-29 18:23:48 +00:00
a87b8d076f Honor @page size and margins in web tests.
After layout for pagination, check if the size of the first page is
different from what was specified initially. If it is, relayout with
that page size. This is the same as what PrintRenderFrameHelper does
(i.e. what we do in regular Chrome). However, we will need to rewrite
this when we add support for mixed page sizes, but before we get there,
it's a step in the right direction not to hardcode the page size, and
behave more similarly to regular printing in Chrome.

This should have allowed us to set the default WPT page size to 5 by 3
inches, just like
http://web-platform-tests.org/writing-tests/print-reftests.html says,
but that would break infrastructure/reftest/reftest_match-print.html
(which passes in Gecko), so we need to keep on using 4 by 2 inches for
now.

Update the bug number for one of the test failures, since it turned out
to be unrelated to this issue.

No behavior changes outside running web tests intended.

Bug: 1416181
Change-Id: I809901af7c2a1f8b06947de997dd226722fe8ee7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4654234
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1163637}
2023-06-28 17:26:00 +00:00
dcee6b7744 Remove page sizing hacks for print web tests, and fix tests.
To retain the current behavior in print web tests in crrev.com/c/4567866
we kept the magical scaling of 1.3333... there. Although
PrintFrameToBitmap() suggested that it wanted things in CSS pixels (the
parameter is named page_size_in_pixels), we were actually expecting it
to be in points, since Blink would perform that conversion (prior to the
aforementioned CL). So we added a temporary points-to-CSS-pixels
conversion borkery right there in that function.

This CL removes all such temporary conversion hacks, and contains all
the necessary test rebaselines and rewrites.

For WPT print reftests in particular, though, the situation was a bit
different. We were already passing the page size (4 by 2 inches) in
points to PrintFrameToBitmap() (even though the parameter is named
page_size_in_pixels). So now we have to actually pass it in pixels. :)
Multiply the inches by 96 instead of 72, and explain why we use 4 by 2,
and not 5 by 3, for the time being.

A few reftest expectations had to be changed, because the page size has
changed. E.g. for web_tests/printing/multicol-2-pages.html, only 4 lines
(instead of 5) will fit on the first page now.

This also fixes two existing reftests, most likely because of rounding
errors no longer being there.

Only web test behavior changes are intended with this CL.

In detail:

- Legacy web test (web_tests/printing/): The page size is 1.333 times
  smaller than before (normally 800 by 600 CSS pixels, instead of 800 by
  600 points).

- WPT print tests: No changes.

Bug: 1450167
Change-Id: I9db5a21f4456730575f2e97b127390299c8fb2c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4643593
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1163438}
2023-06-28 08:20:34 +00:00
9be3a4cb43 Implement get_fedcm_dialog_title and select_fedcm_account in TestDriver
This CL implements two of the FedCM automation commands from
https://fedidcg.github.io/FedCM/#automation. This CL does not yet update
the tests to make use of these methods. A followup is required to stop
auto-selecting accounts in tests so that we can reliably get the title
before the UI is dismissed.

This is needed because WPTs run under content_shell, without
chromedriver support.

Bug: 1453691
Change-Id: I0f7765aa012b38d6e5ce73070cb47341af4f57a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4618303
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1162433}
2023-06-26 15:34:29 +00:00
7992ee231b Reland "Check reportEvent() destination for enrollment/attestation."
This is a reland of commit 4a964f37d1

The original CL was reverted due to conflicts from a change related to
privacy sandbox attestations being checked in around the same time as
this CL. This CL fixes the conflicts associated with the conflicting
changes. Specifically, it accounts for the fact that an instance of the
attestations class is not tied directly to a PrivacySandboxSettings
object anymore and is now obtained with a different call.
See: https://chromium-review.googlesource.com/c/chromium/src/+/4605397

Original change's description:
> Check reportEvent() destination for enrollment/attestation.
>
> Sites must be enrolled in order to use Privacy Sandbox APIs. This CL
> adds a check for event reporting (both through reportEvent() and through
> automatic beacons) that only lets an event get sent out if the site is
> enrolled.
>
> In order for the fenced frame reporter to perform the check, it needs
> access to the browser context. The context is plumbed through the code
> paths that create the FencedFrameReporter object and stored for later
> use. As a side effect, we no longer need to plumb the AttributionManager
> into the FencedFrameReporter, as we can just get it directly from the
> newly plumbed BrowserContext.
>
> This CL also makes changes so that the check will always return true
> when running in all web tests and in certain browser/unit tests.
>
> Change-Id: I1eca7742c99c81c27c5940fc86b0bef46e2e2711
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4594658
> Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
> Reviewed-by: Charlie Harrison <csharrison@chromium.org>
> Reviewed-by: Russ Hamilton <behamilton@google.com>
> Commit-Queue: Liam Brady <lbrady@google.com>
> Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1160466}

Change-Id: I85808d5fd11d030d8d8260332073cba88beb112c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4630152
Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Liam Brady <lbrady@google.com>
Cr-Commit-Position: refs/heads/main@{#1161218}
2023-06-22 15:19:41 +00:00
f6529c7990 Printing: Avoid points<->pixels roundtrips, untangle magical scaling.
Use CSS pixels where we can, most prominently, in WebPrintParams.
Convert directly from device pixels to CSS pixels. We used to convert
from device pixels to points, then pass this to Blink, and Blink would
convert it to CSS pixels. The fact that this conversion was
taking place wasn't exactly obvious. The values were multiplied by
PrintContext::kPrintingMinimumShrinkFactor, which was documented as a
somewhat mysterious factor, that, according to the documentation, used
to be 1.25, but more recent research had shown that 1.33333 was a better
factor. But there's really nothing magical or heuristic about this.
There are 96 CSS pixels per inch, and there are 72 points per inch.
96/72 = 4/3 ~= 1.33333

Don't expose internal Blink scaling (remove WebLocalFrame::
GetPrintPageShrink()). Blink sometimes scales down content to fit more
content in the inline direction (as an attempt to avoid clipping and
thus losing content). Take care of that internally, which is more
consistent. Blink used to do it internally for web tests
(SpoolPagesWithBoundariesForTesting() in WebLocalFrameImpl), whereas for
printing in actual Chrome, it was done on the outside, by
PrintRenderFrameHelper::PrintPageInternal().

This also improves media query evaluation "for free". We used to perform
some strange conversions in PrepareFrameAndViewForPrint::
ResizeForPrinting(). The input size used to be in points, and then we'd
*divide* the height (but not the width!) by 1.333, and then pretend that
the result was in pixels. Now that "everything" is in pixels, things
will improve automatically, unless we make an effort to prevent it. It's
still not quite right, and this CL isn't about that anyway (added TODO).

Also update the header/footer template. PrintHeaderAndFooter() used to
cancel out scaling, including the internal 1/1.333 (3/4) scaling in
Blink, so that content in headers and footers would appear 1.333 (4/3)
times as large as it should be. This has now been untangled and cleaned
up, so we need to ask for the sizes we actually want to see, rather than
3/4 of that. This includes the options passed to
setupHeaderFooterTemplate(). setupHeaderFooterTemplate() specifies the
page size in pixels, although it was actually passed in points. But that
looked just fine, since everything was accidentally (?) zoomed in by
4/3.

There was some confusion on the web tests side of things.
PrintFrameToBitmap() thinks that it takes a page size in pixels, but
this value was multiplied with 1.333 inside Blink afterwards, so it was
effectively points, not pixels. We need to rebaseline or rewrite quite a
few of the tests before we can remove it, so, for now, keep the magical
1.333 scaling thing for tests. Will follow up with a CL that removes
this and rebaselines / rewrites the tests that need it.

Four tests still need to be rebaselined in this CL, though. The
down-scaling of content inside Blink produces slightly different results
now. Since we're using pixels instead of points, and they are passed as
integer values, we end up with a slightly different aspect ratio, so
that LocalFrame::ResizePageRectsKeepingRatio() doesn't behave exactly
like before. Since this CL fixes some rounding errors, two layout tree
dump tests also need to be rebaselined.

Added a few browser tests, both for crbug.com/1444579 (which was the
main motivation for making this change), and also for crbug.com/1117050
since media query evaluation has improved, because we're now using CSS
pixels.

Two of the new tests are disabled. Since we don't support fractional
page sizes, and round down everything to the nearest integer (e.g.
123.9px -> 123px), content that the author would expect to fit on one
page will fragment. Will deal with this in a follow-up.

Bug: 1444579, 1117050
Change-Id: I076cc9f84591b74925465e364ef2f5f4908bb794
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4567866
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1161059}
2023-06-22 06:53:00 +00:00
c61b68aecf Floatify printing code and APIs.
We were passing offsets and sizes as integers. Use floats instead. In
some parts of the code, sizes and offsets are in CSS pixels, in other
parts they are in device pixels, and in some other parts they are in
points. There are reasons for this, although it's currently a bit more
convoluted than it has to be.

Converting between them was done carefully with integer arithmetic and
some special rounding code. This has worked mostly fine, but is fragile.
I'm working on a CL that straightens out the conversions, to use CSS
pixels instead of points in the Blink APIs (since that's what Blink uses
internally). This would however mean that, if we were to keep on using
integers, rounding errors that used to occur when printing HTML with
Blink would be fixed, but, at the same time, we'd introduce new rounding
errors when printing with a plug-in (when opening a PDF and printing
it), since that part of the code wants things in points.

So use floats to avoid this. This also allows for removal of
PrintParamsWithFloatingSize. Although floats have precision issues for
large integer values, this shouldn't be a problem here, since all the
values changed are about page sizes, or offsets into a page (margins,
unprintable area, etc.). Floats have 23 bits for the integer part, so
as long as we stay (way) below a million pixels / points / whatever,
we're good. It would easily become a problem if we start using floats
for offsets into documents, though, as documents can become very tall.

This CL isn't expected to make much of a behavior difference on its
own. We'll still round down sizes to the nearest integer when entering
Blink HTML layout, since we cannot reliably print fractional page sizes
anyway. Furthermore, the way LocalFrame::ResizePageRectsKeepingRatio()
is used to magically convert from points to pixels is inaccurate, and
still causes the symptoms described in crbug.com/1444579

But it should now be more straight-forward to fix such issues without
introducing new ones.

Change-Id: I5fc5afeb14e5470faf970c9f7c94d0fad243ce3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4604506
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1160870}
2023-06-21 21:28:43 +00:00
4ee4fc03b3 Revert "Check reportEvent() destination for enrollment/attestation."
This reverts commit 4a964f37d1.

Reason for revert:
LUCI Bisection identified this CL as the culprit of a build failure. See the analysis: https://luci-bisection.appspot.com/analysis/b/8777709748654697105

Sample failed build: https://ci.chromium.org/b/8777709748654697105

If this is a false positive, please report it at https://bugs.chromium.org/p/chromium/issues/entry?comment=Analysis%3A+https%3A%2F%2Fluci-bisection.appspot.com%2Fanalysis%2Fb%2F8777709748654697105&components=Tools%3ETest%3EFindit&labels=LUCI-Bisection-Wrong%2CPri-3%2CType-Bug&status=Available&summary=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F4594658

Original change's description:
> Check reportEvent() destination for enrollment/attestation.
>
> Sites must be enrolled in order to use Privacy Sandbox APIs. This CL
> adds a check for event reporting (both through reportEvent() and through
> automatic beacons) that only lets an event get sent out if the site is
> enrolled.
>
> In order for the fenced frame reporter to perform the check, it needs
> access to the browser context. The context is plumbed through the code
> paths that create the FencedFrameReporter object and stored for later
> use. As a side effect, we no longer need to plumb the AttributionManager
> into the FencedFrameReporter, as we can just get it directly from the
> newly plumbed BrowserContext.
>
> This CL also makes changes so that the check will always return true
> when running in all web tests and in certain browser/unit tests.
>
> Change-Id: I1eca7742c99c81c27c5940fc86b0bef46e2e2711
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4594658
> Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
> Reviewed-by: Charlie Harrison <csharrison@chromium.org>
> Reviewed-by: Russ Hamilton <behamilton@google.com>
> Commit-Queue: Liam Brady <lbrady@google.com>
> Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1160466}
>

Change-Id: I655728b94fafcf6ee73f81ea24c6d36907364fb4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4631154
Bot-Commit: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Owners-Override: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Commit-Queue: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1160470}
2023-06-21 04:26:00 +00:00
4a964f37d1 Check reportEvent() destination for enrollment/attestation.
Sites must be enrolled in order to use Privacy Sandbox APIs. This CL
adds a check for event reporting (both through reportEvent() and through
automatic beacons) that only lets an event get sent out if the site is
enrolled.

In order for the fenced frame reporter to perform the check, it needs
access to the browser context. The context is plumbed through the code
paths that create the FencedFrameReporter object and stored for later
use. As a side effect, we no longer need to plumb the AttributionManager
into the FencedFrameReporter, as we can just get it directly from the
newly plumbed BrowserContext.

This CL also makes changes so that the check will always return true
when running in all web tests and in certain browser/unit tests.

Change-Id: I1eca7742c99c81c27c5940fc86b0bef46e2e2711
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4594658
Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Russ Hamilton <behamilton@google.com>
Commit-Queue: Liam Brady <lbrady@google.com>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1160466}
2023-06-21 04:10:40 +00:00
5a2a1cfcf4 Make ui::SelectFileDialog::SetFactory() take a std::unique_ptr<> arg
ui::SelectFileDialog::SetFactory() is taking ownership of its argument,
either globally leaking or deleting it, so this makes that more obvious.
It also uncovers a spot in PPAPI where fairly egregious ownership issues
exist. Update a comment here but otherwise leave unchanged.

-- Removes a large number of bare `new`.

-- std::make_unique<> needs more specific type information in a few
   places that just a bare brace-initialized list.

Change-Id: I3111e009a3afc99ff87bd99ca35f3613255ea6e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4616626
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1158899}
2023-06-16 16:45:39 +00:00
e6ff3261cd [test] Run Devtools frontend at different site from inspected page
Currently, devtools web tests serve devtools and the inspected page
from the same site. This interferes with the ongoing experiments
that put the same-site tabs in the same process.

This patch makes sure we serve devtools from a different site from
the inspected page. This is more in line with how we run devtools
in production.

Bug: chromium:1444827
Change-Id: I144f6844fcafe496483ac2e3482a789c37b8856a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574441
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151681}
2023-06-01 06:29:36 +00:00
2eb24c24d2 Use std::string::append(base::StringPiece) instead of decomposing
std::string_view is special because std::string knows how to integrate
with it. Happily, the STL uses a StringViewLike concept, so just by
adding the implicit conversion, we can now write
str.append(piece) instead str.append(piece.data(), piece.size()).

While small, this change keeps us using safe constructs. Clear these out
so we get a little closer to being able to flag accesses of data() as
unsafe. (That's a long ways off, but let's get the easy stuff out of the way.)

A few places (content/web_test/renderer/blink_test_helpers.cc and
net/test/embedded_test_server/http2_connection.cc) were even wrong as
they used .data() without .size() on a string_view/StringPiece.

Bug: 691162
Change-Id: Ib58e00db5f8c2527908c9e7971d28a0b53e68e65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574755
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151252}
2023-05-31 15:29:50 +00:00
9477d45792 Remove use of AppleScrollAnimationEnabled
As noted in

https://developer.apple.com/library/archive/releasenotes/AppKit/RN-AppKitOlderNotes/index.html#:~:text=AppleScrollAnimationEnabled

AppleScrollAnimationEnabled was retired by Apple and replaced by
NSScrollAnimationEnabled in OS X 10.8, so Chromium is in the clear to
stop setting it.

Bug: none
Change-Id: Ic68f9aba0ef50e139f3f33b7ad505485b3e140fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570969
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1150561}
2023-05-30 14:56:43 +00:00
aae248d250 mojo-js: Add tests for versioned Mojo JS bindings
Bug: 657632
Change-Id: Ie117a66faeddf025871b8a9034fdc83c900bb20f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4521143
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1145775}
2023-05-18 02:05:52 +00:00
2547ddac9a Remove DCHECK and replace with early return
Clusterfuzz can hit the DCHECK with a repro that immediately
does a redirect. Rather than crashing, early-out.

Fixed: 1443169
Change-Id: I3102bacb2cf93279bf730b0c542c1d095cd21155
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4545198
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1145636}
2023-05-17 22:00:15 +00:00
d4f0708352 Move backup_util and bundle_locations to base/apple
Bug: 1444927
Change-Id: I1249c06632a27e7c2f403d543f04a815f08bdb00
Include-Ci-Only-Tests: true
Validate-Test-Flakiness: skip
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4525355
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1143395}
2023-05-12 18:05:44 +00:00
0acdd9ab19 mojo: Add support for optional numerics for JS bindings
Supports numerics in three versions of the js bindings:

- Lite JS Bindings, used by some ChromeOS WebUIs.
- Lite JS Bindings for compile, used by ChromeOS WebUIs for type
  checking
- JS module bindings, used mostly in Web Tests.

Bug: 657632
Change-Id: I23de8696ed52abb6cf3af37307a4e6422877e7f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4337119
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1141147}
2023-05-09 02:22:35 +00:00
2ef098fcae Use double-rAF before ending a reftest-wait test
This let content_shell web test mode do the same as wptrunner
(https://github.com/web-platform-tests/wpt/blob/master/tools/wptrunner/wptrunner/executors/test-wait.js)

crbug.com/708757 has been marked as Fixed, but it seems that we still
have cases that ref tests ends prematurely under run_web_tests.py, so
I'm making run_web_tests.py behave the same as wptrunner.

Bug: 708757
Change-Id: I5e20376956925689252e589289d93d65a5485de0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4505400
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1140476}
2023-05-06 06:20:43 +00:00
6a090799ba Convert /content/web_test to use ARC
See https://chromium.googlesource.com/chromium/src/+/main/docs/mac/arc.md
for information about this conversion.

This ended up only adding the ARC boilerplate as a marker to indicate
that these files were audited.

Bug: 1280317
Change-Id: I296923e6a590c36186b45945d50499fce2e348b1
Include-Ci-Only-Tests: true
Validate-Test-Flakiness: skip
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4507299
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1139680}
2023-05-04 18:42:54 +00:00