0
Commit Graph

31 Commits

Author SHA1 Message Date
Weizhong Xia
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
Georg Neis
0a2d42f58a Reland^2 "Lacros testing: Make browser init param overriding more robust"
This is a reland of commit c37505129e,
which was reverted because of unit test failures in CI. These failures
did actually happen in CQ but were hidden there because later reruns
of the tests in isolation passed.

The only change is the weakening of a CHECK in
chromeos/startup/browser_init_params.cc that is necessary as long
as ViewTestsBase is used by both unit (crosapi disabled) and non-unit
(crosapi enabled) tests.

Original change's description:
> Reland "Lacros testing: Make browser init param overriding more robust"
>
> This is a reland of commit e5f6f1434e.
> The only difference is: disabling a test that conflicts with
> the new implementation (see b/323984075).
>
> Original change's description:
> > Lacros testing: Make browser init param overriding more robust
> >
> > See chromium:1508245 for context.
> >
> > - Decide whether crosapi is enabled based on the command line
> >   switches. In particular, make it independent of when/whether
> >   BrowserTestBase::SetUp gets called.
> >   We still provide DisableCrosapiForTesting for legacy reasons,
> >   as some tests need to ovrerride it.
> >
> > - This, plus some new checks, make it hard for tests
> >   * to accidentally and silently override the Ash-provided init
> >     params with mostly empty ones, or
> >   * to accidentally and silently prevent the Ash-provided params
> >     from even being read.
> >
> > - Address a TODO in InProcessBrowserTest thanks to these changes.
> >
> > - Call DisableCrosapiForTesting in ViewsTestBase-derived tests that
> >   run with crosapi enabled but are not prepared to set it up (and thus
> >   would fail one of the new checks) and in fact don't need crosapi.
> >
> > - Remove InProcessBrowserTest::IsCrosapiEnabled() in favor of
> >   !chromeos::BrowserParamsProxy::IsCrosapiDisabledForTesting(). There
> >   is no need to have the InProcessBrowserTest predicate and it's not
> >   an InProcessBrowserTest level concept.
> >
> > - Remove ScopedDisableCrosapiForTesting class, as there is no need for
> >   a scope. Tests should either not call DisableCrosapiForTesting at
> >   all or should do it very early on (CHECK'd). Undoing it is not
> >   supported and it's not neceesary because tests run in separate
> >   processes.
> >
> > - Add documentation to startup/README.md.
> >
> > - Remove some uses of IsCrosapiDisabledForTesting from production code
> >   that are no longer needed.
> >
> > Bug: chromium:1508245
> > Change-Id: Id6b68a25dae4c50132f957f4b80879fdcde2e7b2
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5076190
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> > Commit-Queue: Georg Neis <neis@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1255430}
>
> Bug: chromium:1508245, b/323984075
> Change-Id: I8cced0fe121b3edb757aacc07a706205566cbf24
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5267259
> Auto-Submit: Georg Neis <neis@chromium.org>
> Commit-Queue: Avi Drissman <avi@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1257372}

Bug: chromium:1508245, b/323984075, b/324418102
Change-Id: I49c61ddc09d610962cae6c7bed88f7663d6a7ca5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5281235
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1259615}
2024-02-13 02:05:10 +00:00
Francois Pierre Doray
dc1194af7b Revert "Reland "Lacros testing: Make browser init param overriding more robust""
This reverts commit c37505129e.

Reason for revert: suspect for crbug.com/324418102

Original change's description:
> Reland "Lacros testing: Make browser init param overriding more robust"
>
> This is a reland of commit e5f6f1434e.
> The only difference is: disabling a test that conflicts with
> the new implementation (see b/323984075).
>
> Original change's description:
> > Lacros testing: Make browser init param overriding more robust
> >
> > See chromium:1508245 for context.
> >
> > - Decide whether crosapi is enabled based on the command line
> >   switches. In particular, make it independent of when/whether
> >   BrowserTestBase::SetUp gets called.
> >   We still provide DisableCrosapiForTesting for legacy reasons,
> >   as some tests need to ovrerride it.
> >
> > - This, plus some new checks, make it hard for tests
> >   * to accidentally and silently override the Ash-provided init
> >     params with mostly empty ones, or
> >   * to accidentally and silently prevent the Ash-provided params
> >     from even being read.
> >
> > - Address a TODO in InProcessBrowserTest thanks to these changes.
> >
> > - Call DisableCrosapiForTesting in ViewsTestBase-derived tests that
> >   run with crosapi enabled but are not prepared to set it up (and thus
> >   would fail one of the new checks) and in fact don't need crosapi.
> >
> > - Remove InProcessBrowserTest::IsCrosapiEnabled() in favor of
> >   !chromeos::BrowserParamsProxy::IsCrosapiDisabledForTesting(). There
> >   is no need to have the InProcessBrowserTest predicate and it's not
> >   an InProcessBrowserTest level concept.
> >
> > - Remove ScopedDisableCrosapiForTesting class, as there is no need for
> >   a scope. Tests should either not call DisableCrosapiForTesting at
> >   all or should do it very early on (CHECK'd). Undoing it is not
> >   supported and it's not neceesary because tests run in separate
> >   processes.
> >
> > - Add documentation to startup/README.md.
> >
> > - Remove some uses of IsCrosapiDisabledForTesting from production code
> >   that are no longer needed.
> >
> > Bug: chromium:1508245
> > Change-Id: Id6b68a25dae4c50132f957f4b80879fdcde2e7b2
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5076190
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> > Commit-Queue: Georg Neis <neis@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1255430}
>
> Bug: chromium:1508245, b/323984075
> Change-Id: I8cced0fe121b3edb757aacc07a706205566cbf24
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5267259
> Auto-Submit: Georg Neis <neis@chromium.org>
> Commit-Queue: Avi Drissman <avi@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1257372}

No-Try: true
Bug: chromium:1508245, b/323984075, 324418102
Change-Id: I31f73e8b39d0fb937d1d54816cda3e0b06874749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279657
Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
Auto-Submit: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257970}
2024-02-08 16:46:59 +00:00
Georg Neis
c37505129e Reland "Lacros testing: Make browser init param overriding more robust"
This is a reland of commit e5f6f1434e.
The only difference is: disabling a test that conflicts with
the new implementation (see b/323984075).

Original change's description:
> Lacros testing: Make browser init param overriding more robust
>
> See chromium:1508245 for context.
>
> - Decide whether crosapi is enabled based on the command line
>   switches. In particular, make it independent of when/whether
>   BrowserTestBase::SetUp gets called.
>   We still provide DisableCrosapiForTesting for legacy reasons,
>   as some tests need to ovrerride it.
>
> - This, plus some new checks, make it hard for tests
>   * to accidentally and silently override the Ash-provided init
>     params with mostly empty ones, or
>   * to accidentally and silently prevent the Ash-provided params
>     from even being read.
>
> - Address a TODO in InProcessBrowserTest thanks to these changes.
>
> - Call DisableCrosapiForTesting in ViewsTestBase-derived tests that
>   run with crosapi enabled but are not prepared to set it up (and thus
>   would fail one of the new checks) and in fact don't need crosapi.
>
> - Remove InProcessBrowserTest::IsCrosapiEnabled() in favor of
>   !chromeos::BrowserParamsProxy::IsCrosapiDisabledForTesting(). There
>   is no need to have the InProcessBrowserTest predicate and it's not
>   an InProcessBrowserTest level concept.
>
> - Remove ScopedDisableCrosapiForTesting class, as there is no need for
>   a scope. Tests should either not call DisableCrosapiForTesting at
>   all or should do it very early on (CHECK'd). Undoing it is not
>   supported and it's not neceesary because tests run in separate
>   processes.
>
> - Add documentation to startup/README.md.
>
> - Remove some uses of IsCrosapiDisabledForTesting from production code
>   that are no longer needed.
>
> Bug: chromium:1508245
> Change-Id: Id6b68a25dae4c50132f957f4b80879fdcde2e7b2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5076190
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1255430}

Bug: chromium:1508245, b/323984075
Change-Id: I8cced0fe121b3edb757aacc07a706205566cbf24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5267259
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257372}
2024-02-07 16:18:43 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

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

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

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

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Lei Zhang
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
kylechar
2d46387daa Switch define(USE_OZONE) to BUILDFLAG(IS_OZONE)
Right now ozone platform usage is checked via #if defined(USE_OZONE).
This is error prone as a typo, eg. defined(USE_OZOEN), will compile but
the #if will always be false. BUILDFLAG(IS_OZONE) improves this by
making the typo into a compile error.

Update files in src/content to use the buildflag.

This CL was uploaded by git cl split.

Bug: 1377327
Change-Id: I4fcdf693b329478e874cbac3f525365d93cd006c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3995279
Auto-Submit: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1066513}
2022-11-02 16:14:30 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Steven Holte
e34ff1a71b Remove support for expired/disabled trials.
Reland of https://chromium-review.googlesource.com/c/chromium/src/+/3860053
+ chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.cc
+ content/browser/launch_as_mojo_client_browsertest.cc

Bug: b/242336301
Change-Id: Ib11cedfae4c7ecd97eb4828ace84358c010d6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3884778
Auto-Submit: Steven Holte <holte@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kyle Williams <kdgwill@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047217}
2022-09-15 00:06:56 +00:00
Takashi Sakamoto
48aa47736b Fix LaunchAsMojoClientBrowserTest failure on backuprefptr fyi bots.
Sample test failure:
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-backuprefptr-x64-fyi-rel/11241/test-results?q=LaunchAsMojoClientBrowserTest+

To fix the CHECK failure: trial='StudyPartitionAllocBackupRefPtr' does
not exist, add kForceFieldTrials and kForceFieldTrialParams to
command line before launching content_shell.


Change-Id: I34009d60f857683cf4b2860d290501332bfe79a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3884323
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1045674}
2022-09-12 05:11:24 +00:00
Ken Rockot
062bd47461 Content: Initialize Mojo after FeatureList
This makes it possible to experimentally replace the browser's
Mojo implementation at runtime.

The challenge here is that Mojo initialization needs to follow
FeatureList initialization, and FeatureList initialization is rather
variable across different process types and Content embedders.

After this CL:

- Mojo init logic is hoisted from ContentMainDelegate internals, into
  its own public InitializeMojoCore() API in content/public/app/. This
  includes shared memory allocation hooks and is suitable to call in
  any Content process.

- Content by default still initializes Mojo, but now it always does so
  immediately after FeatureList is initialized.

- Embedders can override Mojo initialization timing as they can override
  FeatureList initialization timing; with the requirement that Mojo is
  still initialized after FeatureList.

After this change, FeatureList will always be initialized by the time
mojo::core::Init() is called by any Content process, allowing the Mojo
implementation used by Content embedders to be configured by feature
flags.

LOW_COVERAGE_REASON=Much of the coverage here comes in the form of existing unit tests and browser tests which only provide coverage with
the MojoIpcz feature enabled. Low coverage will be remedied when
enabling the feature for tests.

Bug: 1299283
Change-Id: I7c37bcb6649d8c1e083639dd48b2170fbdc4f6df
Binary-Size: This is linking in a new library of code (ipcz) previously unused in production. The size increase is unavoidable but temporary, as this new library will eventually replace a library of similar code size which can be dropped from the build.
Fuchsia-Binary-Size: See above note.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3846565
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1044520}
2022-09-08 14:09:06 +00:00
Daniel Cheng
ad44af2f53 Migrate base::{size,empty,data} to STL equivalents in //content.
Bug: 1299695
Change-Id: Iefec40ecc9327c04732785eaed5a3214d17e552f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3491685
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#975485}
2022-02-26 18:07:54 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Alexis Hetu
8a3885daac Change ASH related code from SwiftShader to SwANGLE
Bug: chromium:1060139
Change-Id: Id0aaaacbe6799773818f02070fb75980d77fd821
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3383877
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#960088}
2022-01-17 16:16:15 +00:00
Ken Rockot
b66b0b1ba6 [mojo] reject AddBrokerClient on non-broker nodes
Fixed: 1259557
Change-Id: Ib8d7639b4c200a92336ff6a9f9a80c0560162dbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3223127
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Auto-Submit: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/main@{#949902}
2021-12-09 02:53:15 +00:00
Maksim Sisov
2ac2c31fcb ozone: //content: clean up from USE_X11
This is another CL that removes USE_X11 define and
gn arg usage from //content and also removes
IsUsingOzonePlatform condition as it's no longer
needed as it always resolves to true.

Bug: 1096425
Change-Id: Ibbf2e861b46ffd8156dfe6fd5c6df75c54b83ba9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198073
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/main@{#937765}
2021-11-03 08:00:12 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
Alexis Hetu
bda66cce35 Attempt to solve headless related SwANGLE issues
This CL does a few things:
- It re-enables the HeadlessBrowserTest.WebGLSupported test
- It forces keeping SwANGLE as the chosen GL implementation,
  even when SwiftShader for WebGL is selected
- It changes 2 switches in the code to proper constants,
  rather than hardcoded strings

Bug: chromium:1196363
Bug: chromium:1195289
Change-Id: I1b8051d1bf4a6de066554fc3b8b40df0325bfdf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2809658
Commit-Queue: Alexis Hetu <sugoi@google.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#870485}
2021-04-08 13:04:56 +00:00
Yuta Hijikata
d0a8b6b606 LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)
The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_ash with some special cases (For those cases please
refer to http://go/lacros-macros).

The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.

Bug: 1052397
Change-Id: Ieb265e116ff6ada5e2f99d609ff12fb9f92727e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2534271
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829687}
2020-11-20 16:36:15 +00:00
Guido Urdaneta
ef4e919472 Reland "Move base/test/bind_test_util.h to base/test/bind.h"
This reverts commit 8bd07a6cf9.

Reason for revert: This revert was incorrect and breaks the build.

Original change's description:
> Revert "Move base/test/bind_test_util.h to base/test/bind.h"
>
> This reverts commit a4493a6f80.
>
> Reason for revert: This CL breaks internal builds (e.g. /chrome/browser/media/kaleidoscope/internal/kaleidoscope_browsertest.cc).
>
> Original change's description:
> > Move base/test/bind_test_util.h to base/test/bind.h
> >
> > Stop relying on us to remember arcane file names when writing tests,
> > and repeating the directory hierarchy into the file name.
> >
> > R=​dcheng@chromium.org
> > TBR=
> > NOPRESUBMIT=true
> >
> > Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
> > Commit-Queue: danakj <danakj@chromium.org>
> > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#825145}
>
> TBR=danakj@chromium.org,dcheng@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Change-Id: If165b8443662baa564895e994ea0d772348e6da6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526102
> Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
> Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#825328}

TBR=danakj@chromium.org,dcheng@chromium.org,antrim@chromium.org

# Not skipping CQ checks because this is a reland.
NOPRESUBMIT=true
NOTREECHECK=true

No-Try: True
Change-Id: I6a8c0c8bbb1c8f87cc7f2df7a8b3388971292975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526683
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825329}
2020-11-09 15:06:24 +00:00
Denis Kuznetsov [CET]
8bd07a6cf9 Revert "Move base/test/bind_test_util.h to base/test/bind.h"
This reverts commit a4493a6f80.

Reason for revert: This CL breaks internal builds (e.g. /chrome/browser/media/kaleidoscope/internal/kaleidoscope_browsertest.cc).

Original change's description:
> Move base/test/bind_test_util.h to base/test/bind.h
>
> Stop relying on us to remember arcane file names when writing tests,
> and repeating the directory hierarchy into the file name.
>
> R=​dcheng@chromium.org
> TBR=
> NOPRESUBMIT=true
>
> Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
> Commit-Queue: danakj <danakj@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#825145}

TBR=danakj@chromium.org,dcheng@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: If165b8443662baa564895e994ea0d772348e6da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526102
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825328}
2020-11-09 14:21:28 +00:00
danakj
a4493a6f80 Move base/test/bind_test_util.h to base/test/bind.h
Stop relying on us to remember arcane file names when writing tests,
and repeating the directory hierarchy into the file name.

R=dcheng@chromium.org
TBR=
NOPRESUBMIT=true

Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825145}
2020-11-07 01:53:08 +00:00
Ken Rockot
ef1887e41b Speculative fix for browser test MSAN flake
These browser tests launch a separate browser process to communicate
with. The browser process starts its own GPU process, and MSAN can hit
uninitialized values in some GL drivers on Chrome OS.

This ensures that the launched browser always uses swiftshader for GL to
avoid any such memory issues.

Fixed: 1131586
Change-Id: I012853118d390c4893933279930a64bba42028bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437017
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#811769}
2020-09-29 18:18:12 +00:00
Hidehiko Abe
23e45e8db0 Lacros: Move mojo handshake to earlier stage.
Lacros used to use mojo_base::mojo::Binder to establish the
Mojo connection between Lacros and Ash chromes,
preferring the plataform independent way.
However, it is too late for passing initializing parameters,
which needs to be passed before starting the main message loop.

This CL directly binds the LacrosChromeService,
so that parameters can be available at earlier timing.

Bug: 1115092
Test: Ran Lacros locally.
Change-Id: I5345fa4bfe57b9a922e2d6c389c579266893d03b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353976
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801311}
2020-08-25 08:41:48 +00:00
Sean McAllister
0d73ca3d80 Refactor OS_LINUX preprocessor directive for LaCrOS effort.
Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

Bug: 1110266
Change-Id: Iebbe654853bebeb4af49c9cb793dae5938416f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351374
Commit-Queue: Sean McAllister <smcallis@google.com>
Reviewed-by: Drew Wilson <atwilson@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Mike Wittman <wittman@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799710}
2020-08-19 17:54:37 +00:00
Maksim Sisov
864826dde1 Ozone: Tests must respect UseOzonePlatform and OzonePlatform switches
There are some tests that create own cmdline that results in
missing kEnableFeatures and kOzonePlatform switches. As a consequence,
the browser parts start with a wrong config, which results in
failures and usage of the non-Ozone path for the use_x11 && use_ozone
config, and also in usage of the wrong OzonePlatform as it doesn't
know what platform the test has been launched with (linux-ozone-rel
testers pass headless/wayland/x11 to the cmdline, for example).

Solution is to copy all the previous switches.

Bug: 1115055
Change-Id: Ia7a1f2688b1d697073a96c6527145342deb13778
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346355
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799287}
2020-08-18 20:18:50 +00:00
Ken Rockot
0634566b99 Disable LaunchAsMojoClientBrowserTest.WithMojoCoreLibrary on CFI
This test is flaky under CFI builds.

Fixed: 1103654
Tbr: kinuko@chromium.org
Change-Id: I40e75e472c33442f86ebdf0ec163cea54750f7b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291230
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787021}
2020-07-10 00:34:26 +00:00
Ken Rockot
2fc09267f9 Reland "Support dynamic Mojo Core on Linux"
This is a reland of 002e044483

No changes other than disabling the test under MSan where
it is broken and probably not worth fixing.

Original change's description:
> Support dynamic Mojo Core on Linux
>
> This introduces a new --mojo-core-library-path Content switch which
> instructs Content to initialize each process with an implementation
> of Mojo Core found in the referenced shared library rather than using
> the version linked into the main binary.
>
> This allows for IPC interoperability between a Content embedder and
> another application which provides its own copy of Mojo Core.
>
> Fixed: 1082473
> Change-Id: I1e50c505e91a53e60056a4b8c691d91728f7a5ea
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229664
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#778002}

Tbr: avi@chromium.org
Change-Id: I6a2270c87c294455907fb369640b3be0819b2431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247166
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#780151}
2020-06-19 03:21:30 +00:00
Nancy Wang
62ff80c4da Revert "Support dynamic Mojo Core on Linux"
This reverts commit 002e044483.

Reason for revert: <INSERT REASONING HERE>
It looks like this CL breaks build:
https://ci.chromium.org/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/19458?blamelist=1#blamelist-tab

Original change's description:
> Support dynamic Mojo Core on Linux
> 
> This introduces a new --mojo-core-library-path Content switch which
> instructs Content to initialize each process with an implementation
> of Mojo Core found in the referenced shared library rather than using
> the version linked into the main binary.
> 
> This allows for IPC interoperability between a Content embedder and
> another application which provides its own copy of Mojo Core.
> 
> Fixed: 1082473
> Change-Id: I1e50c505e91a53e60056a4b8c691d91728f7a5ea
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229664
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#778002}

TBR=avi@chromium.org,rockot@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I70d8f420bdaafd1e8f27b3c36a422de4ee8e68ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2245413
Reviewed-by: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778176}
2020-06-15 03:27:29 +00:00
Ken Rockot
002e044483 Support dynamic Mojo Core on Linux
This introduces a new --mojo-core-library-path Content switch which
instructs Content to initialize each process with an implementation
of Mojo Core found in the referenced shared library rather than using
the version linked into the main binary.

This allows for IPC interoperability between a Content embedder and
another application which provides its own copy of Mojo Core.

Fixed: 1082473
Change-Id: I1e50c505e91a53e60056a4b8c691d91728f7a5ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229664
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#778002}
2020-06-12 23:15:14 +00:00
Ken Rockot
b86921c771 Support launching the browser as a Mojo client
This adds support for launching the browser (for any Content
embedder) with a Mojo invitation on the command line, allowing
external clients to include the browser process in a pre-existing
Mojo process network and access a generic primordial Binder
interface akin to InterfaceProvider.

A simple browser test is added to verify that Content Shell can be
launched in this mode and the primordial Binder can be used by the
external launcher (in this case, content_browsertests) to bind a
new testing control interface (content.mojom.ShellController)
exposed by Content Shell.

See crbug.com/1082454 for motivating use cases.

Bug: 1082444, 1082454
Change-Id: I2cfc66d94aa9bdb5072e8ca63d95ae562b63b5b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2200004
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773320}
2020-05-29 20:35:50 +00:00