0
Commit Graph

699 Commits

Author SHA1 Message Date
ddedf8e944 Allow running inspector protocol tests using protocol logs
This CL implements a flag called `--inspector-protocol-log` that accepts
a path to a Chrome DevTools Protocol message log. If specified, the test
runner would replay the log mocking the actual browser. The purpose of
this flag is to allow reproducing test flakiness locally and it is not
meant to be used on the bots for now.

Bug: 327140253
Change-Id: I871442d568878b3a1a0d71a18eb2eb721b457e76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331573
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274969}
2024-03-19 16:16:58 +00:00
b6d476aca1 [FedCM] Ensure that we reset FedCM state between tests
The web_test runner already resets a lot of state between tests; add FedCM
to the list.

This fixes fecdm-login-status-unknown.html when not run on its own.

Bug: 329477540
Change-Id: I13d99ec5f95ecab1b5abd97adf2852cc151bd6f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5372545
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1273406}
2024-03-15 15:05:42 +00:00
49b6ec0bfe Revert "Update test runner to account for same-site RFH change"
This reverts commit 0b48266711.

Reason for revert: Causes widespread flakiness in http/tests/devtools
web tests. see crbug.com/329487276 for one example bug with links to
test histories.

Original change's description:
> Update test runner to account for same-site RFH change
>
> With RenderDocument, we can change RenderFrames within the same
> process. This is not currently handled correctly by some parts of the
> WebTestControlHost. This is fixed by this CL by:
> - Making WebTestWindowObserver observe  pre-existing speculative RFHs
> (it would miss them otherwise since those already called
> RenderFrameCreated before the construction of WebTestWindowObserver)
> - Making WebTestControlHost call ReplicateWebTestRuntimeFlagsChanges
> on all WebTestRenderFrameRemotes instead of only one per renderer
> process (as there can be multiple)
>
> Bug: 936696
> Change-Id: I4184a29de9c21bce3029fbe7bd7d15ffa98b10db
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368628
> Reviewed-by: Fergal Daly <fergal@chromium.org>
> Auto-Submit: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Fergal Daly <fergal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1271970}

Bug: 936696, 329518758, 329487276
Change-Id: I1ea2466a6672ba21d0dfdd702bb0899b481171f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5366211
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1272667}
2024-03-14 10:22:16 +00:00
0b48266711 Update test runner to account for same-site RFH change
With RenderDocument, we can change RenderFrames within the same
process. This is not currently handled correctly by some parts of the
WebTestControlHost. This is fixed by this CL by:
- Making WebTestWindowObserver observe  pre-existing speculative RFHs
(it would miss them otherwise since those already called
RenderFrameCreated before the construction of WebTestWindowObserver)
- Making WebTestControlHost call ReplicateWebTestRuntimeFlagsChanges
on all WebTestRenderFrameRemotes instead of only one per renderer
process (as there can be multiple)

Bug: 936696
Change-Id: I4184a29de9c21bce3029fbe7bd7d15ffa98b10db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368628
Reviewed-by: Fergal Daly <fergal@chromium.org>
Auto-Submit: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1271970}
2024-03-13 03:41:07 +00:00
cc7f1213d5 Add Web-Platform-Tests for Real-World-Identity part 2/2
BUG=326503088

Change-Id: I0a2243da30719590522f86ba3b02f92d1542dd91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5321979
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1270250}
2024-03-08 17:43:34 +00:00
085ffbb5cf Include Chrome DevTools Protocol logs in stderr for inspector-protocol tests
This CL adds logging of Chrome DevTools Protocol messages as processed
by DevToolsProtocolTestBindings to stderr for debugging purposes. The
messages are prefixed with `Protocol message: ` to be able to
distinguish them from other messages. While for successful runs the CDP
log is not very important, there seems to be no easy way to ensure logs
are flushed before the test runner kills the content shell process.

Current results for a failure: https://ci.chromium.org/ui/p/chromium/builders/try/mac-rel/1692853/test-results?q=ID%3Aninja%3A%2F%2F%3Ablink_web_tests%2Fhttp%2Ftests%2Finspector-protocol%2Fissues%2Fcss-appearance-non-standard-issue.js+V%3Abuilder%3Dmac-rel+V%3Aos%3DMac-13+V%3Atest_suite%3Dblink_web_tests

Results with this CL: https://luci-milo.appspot.com/ui/inv/task-chromium-swarm.appspot.com-6804da9cd53c9211/test-results?q=ExactID%3Aninja%3A%2F%2F%3Ablink_web_tests%2Fhttp%2Ftests%2Finspector-protocol%2Ftarget%2Fauto-attach-wait-for-debugger-2-sessions-worker.js+VHash%3A32f081785efe9631

Bug: chromium:327140253
Change-Id: I9fab22e7facd4be4fa4f51f2e59b17444833566c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5318502
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269584}
2024-03-07 15:32:46 +00:00
9bb588200a [FedCM] Add a webdriver command for the "Use Other Account" button
Bug: 327458808
Change-Id: Ia9c575f61772588efbaa72943115de250c225433
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5341752
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268650}
2024-03-05 20:23:28 +00:00
a6aa6dd76b Make the FedCM team the OWNERS of *fedcm*
Change-Id: I87c5a2b83e4e57b1cfebd6b971dbcff342a01761
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5346030
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268582}
2024-03-05 18:39:00 +00:00
dae52e96a5 Reland "[base] Update Erase()/EraseIf() calls for std::vector<> in misc files"
This is a reland of commit 98f692f99b

Original change's description:
> [base] Update Erase()/EraseIf() calls for std::vector<> in misc files
>
> They're now replaced with C++20 std::erase()/std::erase_if().
>
> Script:
> ```
> * extract files referencing Erase()/EraseIf() on cs via css selectors *
>
> 1. Run sed replacements:
> 's/base::EraseIf/std::erase_if/g'
> 's/base::Erase/std::erase/g'
> 's/#include "b/c/cxx20_erase.h"/#include <vector>/g'
> 's/#include "b/c/cxx20_erase_vector.h"/#include <vector>/g'
>
> 2. Run git cl format to sieve <vector> include upwards
> 3. Run sed with -z to separate <vector> include from quoted includes
> (above and below)
>
> 's/\n\n#include <vector>\n/\n#include <vector>\n\n/g'
> 's/"\n#include <vector>/"\n\n#include <vector>/g'
>
> 4. Run sed with -z to force <vector> includes on the remaining files:
>
> 's/#include <(\w+)>/#include <\1>\n#include <vector>/g'
>
> 5. Run git cl format to collapse duplicate <vector> includes
>
> 6. Fix outliers by hand :)
> ```
>
> Bug: 40256229
> Change-Id: I003c7c750afbff4e1710990f438567640b753287
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331992
> Auto-Submit: Andrew Rayskiy <greengrape@google.com>
> Owners-Override: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Peter Kasting <pkasting@chromium.org>
> Commit-Queue: Andrew Rayskiy <greengrape@google.com>
> Cr-Commit-Position: refs/heads/main@{#1268370}

Bug: 40256229
Change-Id: Ic6bb42c33586ad47a5d6504e410e458b9be53d96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5345270
Commit-Queue: Andrew Rayskiy <greengrape@google.com>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268542}
2024-03-05 17:53:36 +00:00
b24693e46b Revert "[base] Update Erase()/EraseIf() calls for std::vector<> in misc files"
This reverts commit 98f692f99b.

Reason for revert: Tree Closure

Original change's description:
> [base] Update Erase()/EraseIf() calls for std::vector<> in misc files
>
> They're now replaced with C++20 std::erase()/std::erase_if().
>
> Script:
> ```
> * extract files referencing Erase()/EraseIf() on cs via css selectors *
>
> 1. Run sed replacements:
> 's/base::EraseIf/std::erase_if/g'
> 's/base::Erase/std::erase/g'
> 's/#include "b/c/cxx20_erase.h"/#include <vector>/g'
> 's/#include "b/c/cxx20_erase_vector.h"/#include <vector>/g'
>
> 2. Run git cl format to sieve <vector> include upwards
> 3. Run sed with -z to separate <vector> include from quoted includes
> (above and below)
>
> 's/\n\n#include <vector>\n/\n#include <vector>\n\n/g'
> 's/"\n#include <vector>/"\n\n#include <vector>/g'
>
> 4. Run sed with -z to force <vector> includes on the remaining files:
>
> 's/#include <(\w+)>/#include <\1>\n#include <vector>/g'
>
> 5. Run git cl format to collapse duplicate <vector> includes
>
> 6. Fix outliers by hand :)
> ```
>
> Bug: 40256229
> Change-Id: I003c7c750afbff4e1710990f438567640b753287
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331992
> Auto-Submit: Andrew Rayskiy <greengrape@google.com>
> Owners-Override: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Peter Kasting <pkasting@chromium.org>
> Commit-Queue: Andrew Rayskiy <greengrape@google.com>
> Cr-Commit-Position: refs/heads/main@{#1268370}

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 40256229
Change-Id: I2b1df1964acc5d5594f37346311637d7b702e287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5340463
Owners-Override: Aya Elsayed <ayaelattar@chromium.org>
Commit-Queue: Luca Accorsi <accorsi@google.com>
Auto-Submit: Aya Elsayed <ayaelattar@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Luca Accorsi <accorsi@google.com>
Cr-Commit-Position: refs/heads/main@{#1268375}
2024-03-05 12:10:17 +00:00
98f692f99b [base] Update Erase()/EraseIf() calls for std::vector<> in misc files
They're now replaced with C++20 std::erase()/std::erase_if().

Script:
```
* extract files referencing Erase()/EraseIf() on cs via css selectors *

1. Run sed replacements:
's/base::EraseIf/std::erase_if/g'
's/base::Erase/std::erase/g'
's/#include "b/c/cxx20_erase.h"/#include <vector>/g'
's/#include "b/c/cxx20_erase_vector.h"/#include <vector>/g'

2. Run git cl format to sieve <vector> include upwards
3. Run sed with -z to separate <vector> include from quoted includes
(above and below)

's/\n\n#include <vector>\n/\n#include <vector>\n\n/g'
's/"\n#include <vector>/"\n\n#include <vector>/g'

4. Run sed with -z to force <vector> includes on the remaining files:

's/#include <(\w+)>/#include <\1>\n#include <vector>/g'

5. Run git cl format to collapse duplicate <vector> includes

6. Fix outliers by hand :)
```

Bug: 40256229
Change-Id: I003c7c750afbff4e1710990f438567640b753287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331992
Auto-Submit: Andrew Rayskiy <greengrape@google.com>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Andrew Rayskiy <greengrape@google.com>
Cr-Commit-Position: refs/heads/main@{#1268370}
2024-03-05 11:35:16 +00:00
da9dafd2c8 content mojom: represent layout test result as ByteString
In theory the layout dump ought to be a dump of the page's layout (so
valid UTF-8) but in practice:

a) many of the test pages deliberately use invalid UTF-8, and
b) tests can and do override the "layout dump" to have other meanings

so just use a ByteString for it.

Bug: 326376204
Change-Id: I9ccfb27c09cb26476484b5743e0edc42fd891f61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5333920
Auto-Submit: Elly FJ <ellyjones@chromium.org>
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1267289}
2024-03-01 00:15:18 +00:00
3ef5fa7865 Fix incorrect boolean array size calculation
The '+' operator has higher precedent than the '>>' operator:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#table

This means that the computation:

headerSize + (value.length + 7) >> 3

will end up dividing headerSize by 8 as well. This results in an error:

"RangeError: Offset is outside the bounds of the DataView"

Change-Id: Id9b176d6495581851cab80f863da974bab3a4e4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5332847
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Fred Shih <ffred@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1267225}
2024-02-29 21:46:40 +00:00
2e1af41377 Reland : "[A11y] Stable ids for AXObjects with DOM nodes"
This is a reland of commit 01466963a4
Reland  was reverted because TAST test inputs.VirtualKeyboardAccent
still fails sometimes.
Reland  was reverted because of failing mac test:
DumpAccessibilityEventsTest.AccessibilityEventsAriaComboBoxNext
https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/34319/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/mac13-arm64-rel-tests/17422/overview
This occurred because we accidentally picked up a
flaky test result via rebase_dump_accessibility_tree_test.py.

Original change's description:
Reland: [A11y] Stable ids for AXObjects with DOM nodes

Reland of CL:4027071. The revert was caused because of the breaking
of a TAST test. Basically, some code in AXTreeSerializer that deleted
subtrees of old child ids is not triggered as often, because if the
DOM node doesn't change, the child ID doesn't. That's a good thing
usually, but if the node is reattached with new style, we need to
make sure its children are reconsidered. The fix is that in the
specific case where a node is reattached, call ChildrenChanged() instead
of just marking it dirty -- in
AXObjectCacheImpl::UpdateCacheAfterNodeIsAttached().

----

Use the DOM node for the AXID for any AXObject with a DOM node.
Other AXObjects will still generate their AXID, but in their own
numerical namespace. For now, any AXID < 0 will be a generated ID.

Role changes and alerts required some new browser-side code, because
rather than the object being destroyed and created with a new id,
the ID now stays the same.

In some cases, test results have improved, e.g. rather than an object
being destroyed and created with a different ID, it retains the same ID
and a change event is fired for it.

Benefits:
- Removes over 100 lines of implementation code
- Use less memory: removes ids_in_use_ (set) and
node_object_mapping_ (map).
- Reduce map lookups when an AXObject is removed -- based on the ID
value, we can determine whether it has a DOM node and if it doesn't,
we already know it cannot be in some of the maps
- Make it easier for screen readers to maintain the user's point of
regard within content, even when the layout or role changes. Users
sometimes lose their place, as the screen reader may move the user
to the top. A hope is that this will reduce the occurrences of that
happening. It may even be possible for screen readers to keep their
place in tabs where the AX tree is released from memory and later
regenerated, which could open up possibilities to using less memory.
- Enable the follow-ups listed below.

Follow-up work:
- Refactor content-visibility: auto change handling in a11y
(crbug.com/1380449).
- See if the dom_node_id field in AXNodeData is needed anymore now
that any id >0 is the same as the dom node id.
- Look at simplifying or removing reparenting computations in
AXTreeSerializer. Maybe we can get rid of expensive
AnyDescendantIsReparented().
- Merge GetAXID() and GetExistingAXID() -- see TODO.

Bug: none
Change-Id: I20e35548e249e3675bacf9c97cdb309ceb396c98
Cq-Include-Trybots: luci.chrome.try:chromeos-betty-pi-arc-chrome-accessibility-fyi,chromeos-eve-chrome
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5328829
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1266923}
2024-02-29 12:10:53 +00:00
8274c9b121 Clean up WebPrint* APIs in Blink somewhat.
Blink knows the default page description, so requiring callers to set up
a WebPrintPageDescription object isn't really necessary for
GetPageDescription(). Change from taking an in/out
WebPrintPageDescription parameter to returning one instead.

Move ignore_css_margins and ignore_page_size out of
WebPrintPageDescription. These are input to Blink when generating print
layout and have nothing to do with a specific page. Therefore a better
home for them is WebPrintParams. Because of this change, pass
WebPrintParams, rather than WebPrintPageDescription, into Blink, when
printing.

Now that Blink relies on being provisioned with a default page
description upon LocalFrame::StartPrinting(), we need to make sure that
we don't call into Blink when this hasn't happened (i.e. when printing
plug-ins). Therefore prevent Document::GetPageDescription() from being
called under such circumstances, and instead handle it on the outside.
Also, in order to reduce the number of entry-points (and thus reduce the
number of such guards guards needed from 2 to 1), remove
GetPageSizeType() from the WebLocalFrame API, and move this field to
WebPrintPageDescription.

Change-Id: I1eaa77b6d33125b22ab5ac3ce19bff1b2c5d5e8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5327506
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1266666}
2024-02-28 22:10:42 +00:00
b5e8a122c9 Remove redundant content:: for GetUIThreadTaskRunner/BrowserTaskType
Follow-up of
https://chromium-review.googlesource.com/c/chromium/src/+/5276439/comment/7e9833fe_c465c594/

AX-Relnotes: n/a.
Bug: 1403746
Change-Id: Ia7d838385677d350b803a855271182358acb1468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314820
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265192}
2024-02-26 14:44:07 +00:00
a56154dd81 Extend MiraclePtr coverage to more containers
This rewrites the following containers:
std::list, std::unordered_set, base::flat_set, std::stack, std::queue.

This patch was generated by running
./tools/clang/rewrite_templated_container_fields/rewrite-multiple-platforms.sh

Binary size increase:
The increase is only (~9.5kB) above the per-patch limit (+16kB). This
is not a lot given the size of the rewrite. Increase of around 500kb was
approved for MiraclePtr.

AX-Relnotes: n/a.
Binary-Size: See commit description.
Bug: 325302189
Change-Id: I969ae345ef6d6117d5c1773773be913197ca2e73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5306923
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265100}
2024-02-26 10:21:17 +00:00
8e98d0b38a Fix renderer content settings (part 12 / N)
This CL removes WebContentSettingsClient::AllowScript() and replaces
callsites to instead use LocalFrame::ScriptEnabled(). This is a refactor
that has no intended behavior change, with the exception of an unused
piece of extension functionality which is now disabled.

Previously, WebContentSettingsClient::AllowScript() supported
secondary-patterns. The only way to set secondary patterns was with an
extension API, which was not actually used. This functionality was
unused, and this CL removes support for this functionality.

This CL removes the test WorkerImportModuleBlocked as it tests
conditions that cannot occur in the wild.

Bug: 40282541
Change-Id: Idf8e1c4eb5cedbbb915b72302f213bf416be1e8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5307559
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264761}
2024-02-23 21:42:01 +00:00
ca39dd452b wpt: Enable reftesting a prerendered page
Using reftest-wait in a prerendered page currently doesn't work since
notifyDone for this case is called from script installed by
TestRunnerBindings::Install only for the main window of a test. This
change marks a prerendering page as being in the main window since it
may be activated to become the main window. This ensures its initialized
appropriately and instead ensures the active main frame is used when
looking for _the_ main frame of the main window.

The script to watch for reftest finished, now installed in a prerender,
is amended to only watch for finish when the page becomes active.

A test relying on this is added in https://crrev.com/c/5314213.

Fixed: 40257783
Change-Id: I5eedadb46b10f33535579aa444b3eaf0ac152cf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5317919
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264748}
2024-02-23 21:17:12 +00:00
fe745d0845 Move CreateSharedImage params into a struct
This will make adding new params in the future much easier with much
smaller CLs.

This change starts with SharedImageInterface and stops before all of
the factory CreateSharedImage calls. I'll update those to use this
struct in a followup.

I decided to re-use the ClientSharedImage::Metadata struct, but decided
to move it to shared_image_interface.h to avoid a circular dependency.

Change-Id: Ia67b8ebcaef460194263c19b2c89ce0d85435d5e
Bug: 1430968
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5277601
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Piotr Bialecki <bialpio@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Peter McNeeley <petermcneeley@chromium.org>
Commit-Queue: Kevin Haslett <khaslett@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264548}
2024-02-23 15:18:37 +00:00
1f0d2a10bd Fix renderer content settings (part 11 / N)
This CL removes WebContentSettingsClient::AllowImage() and replaces
callsites to instead use LocalFrame::ImagesEnabled(). This is primarily
a refactor but there is one subtle behavior change. Previously
extensions were able to allow/block images on a per-resource-domain
basis. In the terminology this was known as blocking "secondary urls".
This functionality has never been used, and introduces significant
complexity as it requires that the browser send all "secondary urls" as
patterns to the renderer for performance reasons.

Change-Id: Idd69c8cced1e8116d937532bd9fee86c3e1d861d
Bug: 40282541
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5308361
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264465}
2024-02-23 09:52:11 +00:00
50ae48d07a Revert "Reland : "[A11y] Stable ids for AXObjects with DOM nodes""
This reverts commit db09b1ea6b.

Reason for revert: Failing mac test: DumpAccessibilityEventsTest.AccessibilityEventsAriaComboBoxNext
https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/34319/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/mac13-arm64-rel-tests/17422/overview

Original change's description:
> Reland : "[A11y] Stable ids for AXObjects with DOM nodes"
>
> This is a reland of commit 01466963a4
>
> The reland was reverted because TAST test inputs.VirtualKeyboardAccent still fails sometimes.
>
> Original change's description:
> > Reland: [A11y] Stable ids for AXObjects with DOM nodes
> >
> > Reland of CL:4027071. The revert was caused because of the breaking
> > of a TAST test. Basically, some code in AXTreeSerializer that deleted subtrees of old child ids is not triggered as often, because if the DOM node doesn't change, the child ID doesn't. That's a good thing usually, but if the node is reattached with new style, we need to make sure its children are reconsidered. The fix is that in the specific case where
> > a node is reattached, call ChildrenChanged() instead of just marking it dirty -- in AXObjectCacheImpl::UpdateCacheAfterNodeIsAttached().
> >
> > ----
> >
> > Use the DOM node for the AXID for any AXObject with a DOM node. Other AXObjects will still generate their AXID, but in their own numerical namespace. For now, any AXID < 0 will be a generated ID.
> >
> > Role changes and alerts required some new browser-side code, because rather than the object being destroyed and created with a new id, the ID now stays the same.
> >
> > In some cases, test results have improved, e.g. rather than an object being destroyed and created with a different ID, it retains the same ID and a change event is fired for it.
> >
> > Benefits:
> > - Removes over 100 lines of implementation code
> > - Use less memory: removes ids_in_use_ (set) and node_object_mapping_ (map).
> > - Reduce map lookups when an AXObject is removed -- based on the ID value, we can determine whether it has a DOM node and if it doesn't, we already know it cannot be in some of the maps
> > - Make it easier for screen readers to maintain the user's point of regard within content, even when the layout or role changes. Users sometimes lose their place, as the screen reader may move the user to the top. A hope is that this will reduce the occurrences of that happening. It may even be possible for screen readers to keep their place in tabs where the AX tree is released from memory and later regenerated, which could open up possibilities to using less memory.
> > - Enable the follow-ups listed below.
> >
> > Follow-up work:
> > - Refactor content-visibility: auto change handling in a11y (crbug.com/1380449).
> > - See if the dom_node_id field in AXNodeData is needed anymore now that any id >0 is the same as the dom node id.
> > - Look at simplifying or removing reparenting computations in AXTreeSerializer. Maybe we can get rid of expensive AnyDescendantIsReparented().
> > - Merge GetAXID() and GetExistingAXID() -- see TODO.
> >
> > Bug: none
> > Change-Id: If6af6cb7e0330e8ab28d7a00bcf5bdfe10fbc9aa
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4131180
> > Reviewed-by: David Tseng <dtseng@chromium.org>
> > Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> > Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1093648}
>
> Bug: nonCq-Include-Trybots: luci.chrome.try:chromeos-betty-pi-arc-chrome-accessibility-fyi,chromeos-eve-chrome
> Change-Id: I02dcfbb3c9f4c1fcbe8d30eab4db4ca9549a126b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4185636
> Reviewed-by: David Tseng <dtseng@chromium.org>
> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1264375}

Bug: nonCq-Include-Trybots: luci.chrome.try:chromeos-betty-pi-arc-chrome-accessibility-fyi,chromeos-eve-chrome
Change-Id: I5740e8933f8fcdb6c1a116d304e87193e547ce6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320033
Owners-Override: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1264414}
2024-02-23 04:32:15 +00:00
db09b1ea6b Reland : "[A11y] Stable ids for AXObjects with DOM nodes"
This is a reland of commit 01466963a4

The reland was reverted because TAST test inputs.VirtualKeyboardAccent still fails sometimes.

Original change's description:
> Reland: [A11y] Stable ids for AXObjects with DOM nodes
>
> Reland of CL:4027071. The revert was caused because of the breaking
> of a TAST test. Basically, some code in AXTreeSerializer that deleted subtrees of old child ids is not triggered as often, because if the DOM node doesn't change, the child ID doesn't. That's a good thing usually, but if the node is reattached with new style, we need to make sure its children are reconsidered. The fix is that in the specific case where
> a node is reattached, call ChildrenChanged() instead of just marking it dirty -- in AXObjectCacheImpl::UpdateCacheAfterNodeIsAttached().
>
> ----
>
> Use the DOM node for the AXID for any AXObject with a DOM node. Other AXObjects will still generate their AXID, but in their own numerical namespace. For now, any AXID < 0 will be a generated ID.
>
> Role changes and alerts required some new browser-side code, because rather than the object being destroyed and created with a new id, the ID now stays the same.
>
> In some cases, test results have improved, e.g. rather than an object being destroyed and created with a different ID, it retains the same ID and a change event is fired for it.
>
> Benefits:
> - Removes over 100 lines of implementation code
> - Use less memory: removes ids_in_use_ (set) and node_object_mapping_ (map).
> - Reduce map lookups when an AXObject is removed -- based on the ID value, we can determine whether it has a DOM node and if it doesn't, we already know it cannot be in some of the maps
> - Make it easier for screen readers to maintain the user's point of regard within content, even when the layout or role changes. Users sometimes lose their place, as the screen reader may move the user to the top. A hope is that this will reduce the occurrences of that happening. It may even be possible for screen readers to keep their place in tabs where the AX tree is released from memory and later regenerated, which could open up possibilities to using less memory.
> - Enable the follow-ups listed below.
>
> Follow-up work:
> - Refactor content-visibility: auto change handling in a11y (crbug.com/1380449).
> - See if the dom_node_id field in AXNodeData is needed anymore now that any id >0 is the same as the dom node id.
> - Look at simplifying or removing reparenting computations in AXTreeSerializer. Maybe we can get rid of expensive AnyDescendantIsReparented().
> - Merge GetAXID() and GetExistingAXID() -- see TODO.
>
> Bug: none
> Change-Id: If6af6cb7e0330e8ab28d7a00bcf5bdfe10fbc9aa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4131180
> Reviewed-by: David Tseng <dtseng@chromium.org>
> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1093648}

Bug: nonCq-Include-Trybots: luci.chrome.try:chromeos-betty-pi-arc-chrome-accessibility-fyi,chromeos-eve-chrome
Change-Id: I02dcfbb3c9f4c1fcbe8d30eab4db4ca9549a126b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4185636
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264375}
2024-02-23 01:33:55 +00:00
42290b241f wpt: Fix test_driver's minimize/restore functions.
By default the test_driver API calls should be routed to the window
corresponding to the driver. However the minimize/restore calls use the
top level window. Fix this by passing the frame token to look up the
correct WebContents corresponding to the blink Window.

R=danakj@chromium.org

Bug: 1522213
Change-Id: I99ed32cd4d9020d9832c63344fee004a40461148
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5310776
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263515}
2024-02-21 19:51:38 +00:00
8f0a38f9ca Use --user-data-dir to specify data dir for Content Shell
Chromedriver will provide '--user-data-dir' and read the active port
from there. Using "--user-data-dir" to replace previous "--data-path".

Bug: 1295373
Change-Id: I42766b2d7999b5e33e2dff0be4f54c08cf2a0e78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5226609
Commit-Queue: Weizhong Xia <weizhong@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263050}
2024-02-21 00:50:32 +00:00
f473c24b5e Obliterate ExperimentalRenderer
crrev.com/c/5298894 rendered it not needed. Remove the definition and all usages.

This CL is a no-op.

Bug: 40064499
Change-Id: Ief3c6f697040cf704a8fca57ed8d4fd593db60c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5309774
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262758}
2024-02-20 17:51:15 +00:00
9644a1bfda Replace ExperimentalRenderer with DanglingUntriaged where needed
Bug: 40064499
DanglingUntriaged-notes: we're actually reducing kMayDangle usage
Change-Id: Ifc64d1beac8b219b6e81de304f8061583a557e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5298894
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262647}
2024-02-20 13:01:15 +00:00
075c2ea3ac Content-shell support for the SetRPHRegistrationMode webdriver command
ChromeDriver implements the SetRPHRegistrationMode but the testing bots
use the content-shell instead of a Chrome instance. Hence, we need to
implement the support for this command in the testdriver-vendor.js via
the TestRunner APIs.

Bug: 1359103
Change-Id: Id0fd360ef487b6437e1fe5a104840500802cad12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5205730
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1261541}
2024-02-16 09:36:02 +00:00
86604ecf6e Use string views in ExtractQueryKeyValue.
Bug: 325408566
Change-Id: I67155963b462211fd465e7d3571a06bdb92bdad3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5293421
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: Timothy Gu <timothygu@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1261200}
2024-02-15 18:39:26 +00:00
0d8cb55e91 Cleanup use "" instead of <> for base/ include.
@sdefresne found some #include of "base/..." using the <> notation.
This patches fixes them all.

R: danakj@chromium.org
CC: sdefresne@chromium.org
Bug: chromium:1500249
Change-Id: I125ec1793281b7590d320f7cb1c80020dbf4f391
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237376
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1261088}
2024-02-15 16:16:32 +00:00
36b8c4b9e5 [buganizer] Migrate DIR_METADATA in content/
Migrate all remaining metadata files for content/.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I0266a5d77e464411371ff07d7f861ce41beb7d45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284114
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258967}
2024-02-11 19:25:52 +00:00
133b2d903f Rewrite std::set<T*> into std::set<raw_ptr<T, SetExperimental>>
This patch was generated by running
./tools/clang/rewrite_templated_container_fields/rewrite-multiple-platforms.sh

AX-Relnotes: n/a.
Bug: 41486235
Change-Id: If9280b93e10508add3c9842f2b2ae190bb65c364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5272231
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258472}
2024-02-09 14:01:52 +00:00
a3178ac807 Reset WebTestSensorProviderManager from WebTestControlHost::ResetBrowserAfterWebTest()
Not doing so results in the ScopedVirtualSensorForDevTools instances the
class outliving the WebContentsSensorProviderProxy raw_ptr that
ScopedVirtualSensorForDevTools, which results in a crash when
content_shell is torn down.

Fixed: 40943607
Change-Id: I62c87ad9564c4d923c296cc9ad56f950b6301765
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279377
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1257947}
2024-02-08 16:17:00 +00:00
3a2cee8d43 Use span-based base::MD5Sum: //content/web_test.
This CL was uploaded by git cl split.

R=danakj@chromium.org

Bug: 1490484
Change-Id: I310efa974d9d322cdc1745cdf5168aad73ed4dd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5271321
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257049}
2024-02-06 22:56:56 +00:00
a6ca2f4662 Reland "[A11y] Invalidate AXIDs when those objects are removed"
This is a reland of commit 408b51a92e

Reason for revert: tests leaked. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/5765548086394880

Original change's description:
> [A11y] Invalidate AXIDs when those objects are removed
>
> After CL:4185636, an AXObject may have been detached and recreated
> with the same DOM node, and therefore has the same id (the dom node id).
> This breaks the accessibility object caching mechanism used for web
> tests, which assumes that if it sees the same ID, it can assume the
> object is still the same one. The fix is to notify the caching
> mechanism of detached AXObjects so that it can invalidate the
> corresponding entries.
>
> Bug: none
> Change-Id: I152538644f9dc24d4e7fbfe68057deb4ab4d34aa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262560
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
> Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1256301}

Bug: none
Change-Id: Ie575a935dd9f94a0b9c1332fb3da64894a0164e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5272942
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257009}
2024-02-06 21:31:57 +00:00
9e95df4e9d Revert "[A11y] Invalidate AXIDs when those objects are removed"
This reverts commit 408b51a92e.

Reason for revert:
LUCI Bisection has identified this change as the cause of a test failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/5765548086394880

Sample build with failed test: https://ci.chromium.org/b/8756906566866931889
Affected test(s):
[ninja://:blink_web_tests/accessibility/aria-owns-sends-notification.html](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2F:blink_web_tests%2Faccessibility%2Faria-owns-sends-notification.html?q=VHash%3Aa7adfaf7d8e0d677)
[ninja://:blink_web_tests/accessibility/inline-text-change-style.html](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2F:blink_web_tests%2Faccessibility%2Finline-text-change-style.html?q=VHash%3Aa7adfaf7d8e0d677)
[ninja://:blink_web_tests/accessibility/inline-text-changes.html](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2F:blink_web_tests%2Faccessibility%2Finline-text-changes.html?q=VHash%3Aa7adfaf7d8e0d677)
[ninja://:blink_web_tests/accessibility/menu-list-sends-change-notification.html](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2F:blink_web_tests%2Faccessibility%2Fmenu-list-sends-change-notification.html?q=VHash%3Aa7adfaf7d8e0d677)
[ninja://:blink_web_tests/http/tests/accessibility/file-upload-button-name.html](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2F:blink_web_tests%2Fhttp%2Ftests%2Faccessibility%2Ffile-upload-button-name.html?q=VHash%3Aa7adfaf7d8e0d677)

If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Ftest-analysis%2Fb%2F5765548086394880&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F5262560&type=BUG

Original change's description:
> [A11y] Invalidate AXIDs when those objects are removed
>
> After CL:4185636, an AXObject may have been detached and recreated
> with the same DOM node, and therefore has the same id (the dom node id).
> This breaks the accessibility object caching mechanism used for web
> tests, which assumes that if it sees the same ID, it can assume the
> object is still the same one. The fix is to notify the caching
> mechanism of detached AXObjects so that it can invalidate the
> corresponding entries.
>
> Bug: none
> Change-Id: I152538644f9dc24d4e7fbfe68057deb4ab4d34aa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262560
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
> Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1256301}
>

Bug: none
Change-Id: Id125d790b78f63366a41efe00e0e4266c55fb2df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5270552
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Grosu <kgrosu@google.com>
Commit-Queue: Kevin Grosu <kgrosu@google.com>
Cr-Commit-Position: refs/heads/main@{#1256410}
2024-02-05 21:18:23 +00:00
408b51a92e [A11y] Invalidate AXIDs when those objects are removed
After CL:4185636, an AXObject may have been detached and recreated
with the same DOM node, and therefore has the same id (the dom node id).
This breaks the accessibility object caching mechanism used for web
tests, which assumes that if it sees the same ID, it can assume the
object is still the same one. The fix is to notify the caching
mechanism of detached AXObjects so that it can invalidate the
corresponding entries.

Bug: none
Change-Id: I152538644f9dc24d4e7fbfe68057deb4ab4d34aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262560
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256301}
2024-02-05 18:37:11 +00:00
8104ba8d59 Remove misuses of Empty{GURL,String,String16}(): content/
These are only for functions that need to return a reference, but have
no empty object to return. They are slower than just using the default
constructor directly, and serve no purpose in other use cases.

Bug: none
Change-Id: I9e01c19b4a818d2cfc24b2178ec56b7128a45215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5251800
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1254514}
2024-01-31 15:23:40 +00:00
80356b7eb9 Used std::string base::Base64Encode(StringPiece) instead of void base::Base64Encode(StringPiece, std::string*)
`void base::Base64Encode(StringPiece, std::string*)` is deprecated now.
Used `std::string base::Base64Encode(StringPiece)` in place of the
deprecated one.

in //content/

Bug: 1486214
Change-Id: Ied72235478f9da20a6e43921979128fcca05304e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5173455
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Punith Nayak <npunith125@gmail.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1253286}
2024-01-29 15:28:50 +00:00
94ac55f313 [Code Health] Remove a use of base::SupportsWeakPtr. (web_test)
Bug: 647430
Change-Id: I325edcf5161f93b304a7d5e4dcecdbad8c01379c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5230629
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252004}
2024-01-25 11:06:18 +00:00
4661871d13 [CodeHealth] Rename mouse lock to pointer lock
When the code was originally written, "mouse lock" was a popular term in
the gaming industry and the PointerLock API didn't even exist. Now that
"pointer lock" is an established term, we are switching our codebase
away from the old term to be consistent with the web platform API:
https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API

There still are some names that aren't renamed in this CL, e.g. enum
values recorded in metrics.

There should be no behavioral changes.

Low-Coverage-Reason: TRIVIAL_CHANGE This is a rename CL
Bug: 1518948
Change-Id: Ib66d87e4919c2570109d7e6755ea91dfc18d42fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5148491
Commit-Queue: Takumi Fujimoto <takumif@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Vincent Scheib <scheib@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1251864}
2024-01-25 02:04:18 +00:00
61c4f0c1dc WebDriver based WPT for the 'onmove' handler
This CL defines a new WPT to verify the 'onmove' event handler is
triggered using the Set / Get Window Rect WebDriver command. This way
we ensure that the codepath that emits the event is executed, instead
of using the eventSender to emit a fake event.

Additionally, the CL implements the testdriver-vendor.js support for
these commands.

Bug: 1466855
Change-Id: Iabdd655c06af1eb5979a02a02b3a0fd978b2f6e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5201474
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Stefan Zager <szager@chromium.org>
Reviewed-by: Sonja Laurila <laurila@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1251765}
2024-01-24 23:02:44 +00:00
7725194e5e [A11y] Web tests: do nothing in detached object proxy / a11y state
Speculative fix for Clusterfuzz bug where
a crash occurs in UpdateLayout() on the line
`factory()->GetAXContext()->UpdateAXForAllDocuments();`.

Fixed: 1487291
Change-Id: Iddd631bf55434df4d927c40a67bd56df98db0e48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5198449
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1248927}
2024-01-18 18:47:23 +00:00
2176abe428 Intercept WebSocket requests from extension content scripts
Add support to track web requests made from extension content scripts
in SafeBrowsing's WebsocketHandshakeThrottle. The WebsocketHandshakeThrottle
API is also refactored with a new SecurityOrigin object, which represents
the isolated world origin.

Bug: 1447587
Change-Id: If43fc582e0df1a0c6468e2dbf69f3a39fbce25cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5151056
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Commit-Queue: Richard Chen <richche@google.com>
Reviewed-by: Anunoy Ghosh <anunoy@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1246511}
2024-01-12 17:23:44 +00:00
7cc967a7c0 Improve LoginHandler (Part 9 / N)
This CL is a refactor with no intended behavior change.

This CL modifies CreateLoginDelegate to pass in a BrowserContext. This
is always set, unlike WebContents, which will not be set in the future
for ServiceWorkers.

Change-Id: Ia6c7f1fb6582d1f8989ead805ca48c5614fdb726
Bug: 1371177
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5181931
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1246199}
2024-01-12 03:24:28 +00:00
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
4103b14928 [//content] Refine test_plugin GLES2 SI usage
This code creates SharedImages that are written to via GLES2 and then
sent off to the display compositor in TransferableResources.

Bug: 1512542
Change-Id: Ice1b4530d06e98b50b9088e9fb32836bfb4e3d3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5173528
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243960}
2024-01-08 10:16:50 +00:00
64faea4fd9 Move WebTestControlHost to be associated based on RenderFrameHost
Associate the channel with the frame's associated channel. This
gets rid of the WebTestRenderThread interface and everything is sent
via frame bound interfaces.

Since TestRunner no longer has a WebTestControlHost and it must
be accessed via a WebFrameTestProxy we need to pass the source
of the events into various TestRunner interfaces.

Bug: 993189
Change-Id: Ie4629f90d3bad5ae6a1530c2a7bb87b51bf76280
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5105229
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243614}
2024-01-05 21:37:14 +00:00
be5c7fd1e5 Add PluginPlaceholderBase::Init
Since PluginPlaceholderBase is a WebViewPlugin::Delegate and was
passed in a constructor, the constructor will not be fully completed
yet before virtuals are invoked.

Create the WebView inside a new Init method to ensure that the object
is fully constructed before invoking virtuals on it.

Bug: 1513583
Change-Id: Ic1cc3489b76c848bcc35223b38d7d6cfb5f22213
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5173650
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243569}
2024-01-05 20:05:24 +00:00
abdb9daf28 test_runner: skip local tests if path is absolute
In case the path is absolute, we'll hit a DCHECK in
https://source.chromium.org/chromium/chromium/src/+/main:base/files/file_path.cc;l=527.

Bug: 1513408
Change-Id: Ia6335a06c238b488e35325d56a0257ed06205915
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171577
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Paul Semel <paulsemel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243469}
2024-01-05 17:23:33 +00:00