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}
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}
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}
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}
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}
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}
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}
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}
This is a reland of commit 01466963a4
Reland #1 was reverted because TAST test inputs.VirtualKeyboardAccent
still fails sometimes.
Reland #2 was reverted because of failing mac test:
DumpAccessibilityEventsTest.AccessibilityEventsAriaComboBoxNext
https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/34319/overviewhttps://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}
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}
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}
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}
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}
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}
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}
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/overviewhttps://ci.chromium.org/ui/p/chromium/builders/ci/mac13-arm64-rel-tests/17422/overview
Original change's description:
> Reland #2: "[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}
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}
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}
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}
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}
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}
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}
`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}
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}
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}
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}
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}
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}