Commit 223bc491 authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Commit Bot

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: I86256d662153a26856323316978fa370a0cdc7ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550004
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830478}
parent c58ac2db
......@@ -81,6 +81,7 @@ android_library("content_java") {
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:jni_java",
"//build:chromeos_buildflags",
"//components/download/public/common:public_java",
"//components/payments/mojom:mojom_java",
"//content/public/common:trust_tokens_mojo_bindings_java",
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/ui.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//ppapi/buildflags/buildflags.gni")
......@@ -474,7 +475,7 @@ source_set("browser_sources") {
"//content/browser",
]
if (is_chromeos || is_android || is_chromecast || is_fuchsia) {
if (is_chromeos_ash || is_android || is_chromecast || is_fuchsia) {
defines = [ "ENABLE_PROTECTED_MEDIA_IDENTIFIER_PERMISSION" ]
}
......@@ -529,7 +530,7 @@ source_set("browser_sources") {
]
}
if (is_chromeos) {
if (is_chromeos_ash) {
sources += [
"chromeos/delegate_to_browser_gpu_service_accelerator_factory.h",
"tts_controller_delegate.cc",
......
......@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "device/fido/features.h"
#include "device/fido/fido_discovery_factory.h"
......@@ -88,7 +89,7 @@ AuthenticatorRequestClientDelegate::GetTouchIdAuthenticatorConfig() {
}
#endif // defined(OS_MAC)
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
AuthenticatorRequestClientDelegate::ChromeOSGenerateRequestIdCallback
AuthenticatorRequestClientDelegate::GetGenerateRequestIdCallback(
RenderFrameHost* render_frame_host) {
......
......@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/optional.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/common/content_export.h"
#include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/cable/cable_discovery_data.h"
......@@ -33,7 +34,7 @@ class Origin;
namespace content {
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
class RenderFrameHost;
#endif
......@@ -190,7 +191,7 @@ class CONTENT_EXPORT AuthenticatorRequestClientDelegate
GetTouchIdAuthenticatorConfig();
#endif // defined(OS_MAC)
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Callback that should generate and return a unique request id.
using ChromeOSGenerateRequestIdCallback = base::RepeatingCallback<uint32_t()>;
......@@ -201,7 +202,7 @@ class CONTENT_EXPORT AuthenticatorRequestClientDelegate
// request.
virtual ChromeOSGenerateRequestIdCallback GetGenerateRequestIdCallback(
RenderFrameHost* render_frame_host);
#endif // defined(OS_CHROMEOS)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Returns a bool if the result of the isUserVerifyingPlatformAuthenticator
// API call should be overridden with that value, or base::nullopt otherwise.
......
......@@ -21,6 +21,7 @@
#include "base/notreached.h"
#include "base/sequenced_task_runner.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_main_parts.h"
......@@ -554,7 +555,7 @@ ContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
return nullptr;
}
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
TtsControllerDelegate* ContentBrowserClient::GetTtsControllerDelegate() {
return nullptr;
}
......
......@@ -24,6 +24,7 @@
#include "base/time/time.h"
#include "base/types/strong_alias.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/download/public/common/quarantine_connection.h"
#include "content/common/content_export.h"
#include "content/public/browser/allow_service_worker_result.h"
......@@ -227,7 +228,7 @@ struct SocketPermissionRequest;
class TtsEnvironmentAndroid;
#endif
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
class TtsControllerDelegate;
#endif
......@@ -745,7 +746,7 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual bool AllowConversionMeasurement(
content::BrowserContext* browser_context);
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Notification that a trust anchor was used by the given user.
virtual void OnTrustAnchorUsed(BrowserContext* browser_context) {}
#endif
......@@ -880,7 +881,7 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate();
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Allows the embedder to return a delegate for the TtsController.
virtual TtsControllerDelegate* GetTtsControllerDelegate();
#endif
......
......@@ -9,7 +9,7 @@
#include "build/chromeos_buildflags.h"
#include "content/public/common/content_features.h"
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "content/browser/media/capture/desktop_capturer_lacros.h"
#endif
......@@ -44,7 +44,7 @@ webrtc::DesktopCaptureOptions CreateDesktopCaptureOptions() {
}
std::unique_ptr<webrtc::DesktopCapturer> CreateScreenCapturer() {
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return std::make_unique<DesktopCapturerLacros>(
DesktopCapturerLacros::CaptureType::kScreen,
webrtc::DesktopCaptureOptions());
......@@ -55,7 +55,7 @@ std::unique_ptr<webrtc::DesktopCapturer> CreateScreenCapturer() {
}
std::unique_ptr<webrtc::DesktopCapturer> CreateWindowCapturer() {
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return std::make_unique<DesktopCapturerLacros>(
DesktopCapturerLacros::CaptureType::kWindow,
webrtc::DesktopCaptureOptions());
......
......@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/switches.h"
#include "components/viz/common/features.h"
#include "components/viz/common/switches.h"
......@@ -120,7 +121,7 @@ const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {
gpu_preferences.enable_native_gpu_memory_buffers =
command_line->HasSwitch(switches::kEnableNativeGpuMemoryBuffers);
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
// The direct VideoDecoder is disallowed on some particular SoC/platforms.
const bool should_use_direct_video_decoder =
......@@ -141,7 +142,7 @@ const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {
#else // !BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
gpu_preferences.enable_chromeos_direct_video_decoder = false;
#endif // BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
gpu_preferences.disable_oopr_debug_crash_dump =
......
......@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_BROWSER_IS_UVPAA_H_
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/common/content_export.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
......@@ -30,7 +31,7 @@ CONTENT_EXPORT bool IsUVPlatformAuthenticatorAvailable(
#elif defined(OS_WIN)
CONTENT_EXPORT bool IsUVPlatformAuthenticatorAvailable(device::WinWebAuthnApi*);
#elif defined(OS_CHROMEOS)
#elif BUILDFLAG(IS_CHROMEOS_ASH)
CONTENT_EXPORT bool IsUVPlatformAuthenticatorAvailable();
#else
......
......@@ -5,7 +5,7 @@
#include "content/public/browser/media_keys_listener_manager.h"
#include "build/chromeos_buildflags.h"
#if !defined(OS_CHROMEOS)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/feature_list.h"
#include "media/base/media_switches.h"
#endif
......@@ -14,7 +14,7 @@ namespace content {
// static
bool MediaKeysListenerManager::IsMediaKeysListenerManagerEnabled() {
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
return false;
#else
return base::FeatureList::IsEnabled(media::kHardwareMediaKeyHandling);
......
......@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_BROWSER_NETWORK_CONTEXT_CLIENT_BASE_H_
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/network/public/mojom/network_context.mojom.h"
......@@ -72,7 +73,7 @@ class CONTENT_EXPORT NetworkContextClientBase
const std::string& spn,
OnGenerateHttpNegotiateAuthTokenCallback callback) override;
#endif
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void OnTrustAnchorUsed() override;
#endif
void OnTrustTokenIssuanceDivertedToSystem(
......
......@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/callback_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/common/content_export.h"
#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom-forward.h"
#include "services/network/public/cpp/network_connection_tracker.h"
......@@ -41,7 +42,7 @@ namespace content {
CONTENT_EXPORT network::mojom::NetworkService* GetNetworkService();
// Only on ChromeOS since it's only used there.
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Returns the global NetworkChangeNotifier instance.
CONTENT_EXPORT net::NetworkChangeNotifier* GetNetworkChangeNotifier();
#endif
......
......@@ -4,6 +4,7 @@
import("//build/buildflag_header.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//content/public/common/zygote/features.gni")
......@@ -61,7 +62,10 @@ source_set("static_switches") {
public_configs = [ ":static_switches_defines" ]
# Deps required by the above headers.
deps = [ "//media:media_buildflags" ]
deps = [
"//build:chromeos_buildflags",
"//media:media_buildflags",
]
}
# This target allows you to use the content_features constants and statically
......@@ -75,9 +79,11 @@ source_set("static_features") {
]
public_deps = [ "//base" ]
deps = [ "//build:chromeos_buildflags" ]
public_configs = [ ":static_switches_defines" ]
if (is_chromeos) {
if (is_chromeos_ash) {
public_deps += [ "//media/capture/video/chromeos/public" ]
}
}
......@@ -217,6 +223,7 @@ source_set("common_sources") {
deps = [
":content_descriptor_keys",
"//build:branding_buildflags",
"//build:chromeos_buildflags",
# This looks needless as we have //content/common in public_deps, but it's
# needed because of allow_circular_includes_from.
......@@ -250,7 +257,7 @@ source_set("common_sources") {
deps += [ "//content/public/android:jni" ]
}
if (is_chromeos) {
if (is_chromeos_ash) {
public_deps += [ "//media/capture/video/chromeos/public" ]
}
......
......@@ -5,6 +5,7 @@
#include "content/public/common/content_features.h"
#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
......@@ -48,8 +49,10 @@ const base::Feature kAudioServiceLaunchOnStartup{
// Runs the audio service in a separate process.
const base::Feature kAudioServiceOutOfProcess {
"AudioServiceOutOfProcess",
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
(defined(OS_LINUX) && !defined(OS_CHROMEOS))
(defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
......@@ -99,7 +102,7 @@ const base::Feature kBlockInsecurePrivateNetworkRequests{
"BlockInsecurePrivateNetworkRequests", base::FEATURE_DISABLED_BY_DEFAULT};
// Use ThreadPriority::DISPLAY for browser UI and IO threads.
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
const base::Feature kBrowserUseDisplayThreadPriority{
"BrowserUseDisplayThreadPriority", base::FEATURE_ENABLED_BY_DEFAULT};
#else
......@@ -691,7 +694,7 @@ const base::Feature kTouchpadAsyncPinchEvents{"TouchpadAsyncPinchEvents",
// only enabled by default on CrOS.
const base::Feature kTouchpadOverscrollHistoryNavigation {
"TouchpadOverscrollHistoryNavigation",
#if defined(OS_CHROMEOS) || defined(OS_WIN)
#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
......@@ -780,7 +783,7 @@ const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
// disabled, an occluded WebContents behaves exactly like a VISIBLE WebContents.
const base::Feature kWebContentsOcclusion {
"WebContentsOcclusion",
#if defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_WIN)
#if defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
......@@ -797,7 +800,9 @@ const base::Feature kWebAuth{"WebAuthentication",
// https://w3c.github.io/webauthn
const base::Feature kWebAuthCable {
"WebAuthenticationCable",
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
......@@ -969,7 +974,7 @@ VideoCaptureServiceConfiguration GetVideoCaptureServiceConfiguration() {
// On ChromeOS the service must run in the browser process, because parts of the
// code depend on global objects that are only available in the Browser process.
// See https://crbug.com/891961.
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
return VideoCaptureServiceConfiguration::kEnabledForBrowserProcess;
#else
#if defined(OS_WIN)
......
......@@ -5,6 +5,7 @@
#include "content/public/common/content_switches.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "media/media_buildflags.h"
namespace switches {
......@@ -890,7 +891,7 @@ const char kWebXrRuntimeWMR[] = "windows-mixed-reality";
const char kDisableAcceleratedVideoDecode[] =
"disable-accelerated-video-decode";
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && !defined(OS_ANDROID)
// Enables hardware acceleration of video decoding on linux. (defaults to off)
const char kEnableAcceleratedVideoDecode[] = "enable-accelerated-video-decode";
#endif
......@@ -954,7 +955,9 @@ const char kEnableAggressiveDOMStorageFlushing[] =
// Enable indication that browser is controlled by automation.
const char kEnableAutomation[] = "enable-automation";
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Allows sending text-to-speech requests to speech-dispatcher, a common
// Linux speech service. Because it's buggy, the user must explicitly
// enable it so that visiting a random webpage can't cause instability.
......
......@@ -8,6 +8,7 @@
#define CONTENT_PUBLIC_COMMON_CONTENT_SWITCHES_H_
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/common/content_export.h"
#include "media/media_buildflags.h"
......@@ -244,7 +245,7 @@ CONTENT_EXPORT extern const char kWebXrRuntimeOrientationSensors[];
CONTENT_EXPORT extern const char kWebXrRuntimeOpenXr[];
CONTENT_EXPORT extern const char kWebXrRuntimeWMR[];
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && !defined(OS_ANDROID)
CONTENT_EXPORT extern const char kEnableAcceleratedVideoDecode[];
#endif
CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
......@@ -265,7 +266,9 @@ CONTENT_EXPORT extern const char kRemoteDebuggingSocketName[];
CONTENT_EXPORT extern const char kRendererWaitForJavaDebugger[];
#endif
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
CONTENT_EXPORT extern const char kEnableSpeechDispatcher[];
#endif
......
......@@ -5,6 +5,7 @@
#include "content/public/common/url_constants.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
namespace content {
......@@ -16,7 +17,7 @@ const char kChromeUIScheme[] = "chrome";
const char kChromeUIUntrustedScheme[] = "chrome-untrusted";
const char kGuestScheme[] = "chrome-guest";
const char kViewSourceScheme[] = "view-source";
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kExternalFileScheme[] = "externalfile";
#endif
const char kGoogleChromeScheme[] = "googlechrome";
......
......@@ -10,6 +10,8 @@
#include "content/common/content_export.h"
#include "url/url_constants.h"
#include "build/chromeos_buildflags.h"
// Contains constants for known URLs and portions thereof.
namespace content {
......@@ -23,7 +25,7 @@ CONTENT_EXPORT extern const char kChromeUIScheme[]; // Used for WebUIs.
CONTENT_EXPORT extern const char kChromeUIUntrustedScheme[];
CONTENT_EXPORT extern const char kGuestScheme[];
CONTENT_EXPORT extern const char kViewSourceScheme[];
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
CONTENT_EXPORT extern const char kExternalFileScheme[];
#endif
......
......@@ -115,7 +115,7 @@
#include "ui/aura/test/event_generator_delegate_aura.h" // nogncheck
#endif
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "chromeos/lacros/lacros_chrome_service_impl.h"
......@@ -346,14 +346,14 @@ void BrowserTestBase::SetUp() {
use_software_gl = false;
#endif
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// If the test is running on the chromeos envrionment (such as
// device or vm bots), we use hardware GL.
if (base::SysInfo::IsRunningOnChromeOS())
use_software_gl = false;
#endif
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// If the test is running on the lacros environment, a file descriptor needs
// to be obtained and used to launch lacros-chrome so that a mojo connection
// between lacros-chrome and ash-chrome can be established.
......
......@@ -10,6 +10,7 @@
#include "base/run_loop.h"
#include "base/task/current_thread.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_paths.h"
......@@ -26,11 +27,13 @@
#include "base/mac/foundation_util.h"
#endif
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX)
#include "ui/base/ime/init/input_method_initializer.h"
#endif
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "content/public/test/network_connection_change_simulator.h"
#endif
......@@ -87,7 +90,9 @@ void ContentBrowserTest::SetUp() {
#endif
// LinuxInputMethodContextFactory has to be initialized.
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX)
ui::InitializeInputMethodForTesting();
#endif
......@@ -100,13 +105,15 @@ void ContentBrowserTest::TearDown() {
BrowserTestBase::TearDown();
// LinuxInputMethodContextFactory has to be shutdown.
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX)
ui::ShutdownInputMethodForTesting();
#endif
}
void ContentBrowserTest::PreRunTestOnMainThread() {
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
NetworkConnectionChangeSimulator network_change_simulator;
network_change_simulator.InitializeChromeosConnectionType();
#endif
......
......@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/run_loop.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/network_service_util.h"
#include "mojo/public/cpp/bindings/remote.h"
......@@ -15,7 +16,7 @@
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/mojom/network_service_test.mojom.h"
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "net/base/network_change_notifier_posix.h"
#include "services/network/public/mojom/network_service.mojom.h"
#endif
......@@ -34,7 +35,7 @@ constexpr base::RunLoop::Type kRunLoopType =
NetworkConnectionChangeSimulator::NetworkConnectionChangeSimulator() = default;
NetworkConnectionChangeSimulator::~NetworkConnectionChangeSimulator() = default;
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void NetworkConnectionChangeSimulator::InitializeChromeosConnectionType() {
// Manually set the connection type since ChromeOS's NetworkChangeNotifier
// implementation relies on some other class controlling it (normally
......
......@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_TEST_NETWORK_CONNECTION_CHANGE_SIMULATOR_H_
#include "base/macros.h"
#include "build/chromeos_buildflags.h"
#include "services/network/public/cpp/network_connection_tracker.h"
namespace base {
......@@ -21,7 +22,7 @@ class NetworkConnectionChangeSimulator
NetworkConnectionChangeSimulator();
~NetworkConnectionChangeSimulator() override;
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Initializes the ChromeOS network connection type.
// This should be used in tests that don't have a DBus set up.
void InitializeChromeosConnectionType();
......
......@@ -749,6 +749,7 @@ static_library("browsertest_support") {
"//base:i18n",
"//base/test:test_config",
"//base/test:test_support",
"//build:chromeos_buildflags",
"//components/network_session_configurator/common:common",
"//content/app:for_content_tests",
"//content/browser:for_content_tests",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment