Lacros-Test: Skip crosapi version check if already supported in ash.

This is a follow up cl for crrev.com/c/5117919.

Due to an issue with some tests improperly calling
BrowserInitParams::SetInitParamsForTests in test
Setup() which wipes out interceface_versions data
in BrowserInitParams, when IsTestControllerAvailable()
is called in browser_test_util to check if a TestControl
method is supported in ash, it failed incorrectly(the method is
available in all ash channels). This issue blocks another pending cl(crrev.com/c/5068434) since it calls browser_test_util::WaitForWindowCreation from
InProcessBrowserTest:: PreRunTestOnMainThread() and will
failed in IsTestControllerAvailable() for those tests which
wipes out BrowserInitParams::interface_versions by calling BrowserInitParams::SetInitParamsForTests. There
is already an ongoing effort to fix the root cause of
BrowserInitParams::SetInitParamsForTests issue, but it will
take some time to land that cl.

As a workaround to unblock crrev.com/c/5068434, this cl
removes the code for handling version skew if
the crosapi method already supported by all ash channels.
Instead, we validate if TestController is available in
LacrosService before calling crosapi. When test code calls
the apis in browser_test_utils to wait for UI elements to be
created in ash, ash should be available. If ash is not available
for some reason, it may expose some real problem to be fixed.
This should be handled differently than the cases in which
the crosapi is not supported in ash or the operation times out
(The existing code returns false for all these cases). Now the functions
fail with CHECK if ash is not available, and return false if crosapi
is not supported by ash or times out.

I patched crrev.com/c/5068434 with this cl and it passes CQ
run(crrev.com/c/5121452).


Bug: NONE
Change-Id: I5d4cc186df54083750c10c90d6ee7e18bbff46eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5120010
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1237592}
2 files changed
tree: 835111ef38c5e6879ab61a76e138bb67e25ae595
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. courgette/
  16. crypto/
  17. dbus/
  18. device/
  19. docs/
  20. extensions/
  21. fuchsia_web/
  22. gin/
  23. google_apis/
  24. google_update/
  25. gpu/
  26. headless/
  27. infra/
  28. ios/
  29. ipc/
  30. media/
  31. mojo/
  32. native_client_sdk/
  33. net/
  34. pdf/
  35. ppapi/
  36. printing/
  37. remoting/
  38. rlz/
  39. sandbox/
  40. services/
  41. skia/
  42. sql/
  43. storage/
  44. styleguide/
  45. testing/
  46. third_party/
  47. tools/
  48. ui/
  49. url/
  50. webkit/
  51. .clang-format
  52. .clang-tidy
  53. .clangd
  54. .eslintrc.js
  55. .git-blame-ignore-revs
  56. .gitattributes
  57. .gitignore
  58. .gitmodules
  59. .gn
  60. .mailmap
  61. .rustfmt.toml
  62. .vpython3
  63. .yapfignore
  64. ATL_OWNERS
  65. AUTHORS
  66. BUILD.gn
  67. CODE_OF_CONDUCT.md
  68. codereview.settings
  69. DEPS
  70. DIR_METADATA
  71. LICENSE
  72. LICENSE.chromium_os
  73. OWNERS
  74. PRESUBMIT.py
  75. PRESUBMIT_test.py
  76. PRESUBMIT_test_mocks.py
  77. README.md
  78. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.