0

Remove lacros support code from //components/gcm_driver

Lacros is deprecated.

Bug: 373971535, 373972275, 381281319
Change-Id: I0cab9c62e484dd7ec33fac4aa9df75c7b01c3b70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6063666
Reviewed-by: Rushan Suleymanov <rushans@google.com>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1391593}
This commit is contained in:
Maksim Sisov
2024-12-04 11:51:43 +00:00
committed by Chromium LUCI CQ
parent 3b04666c35
commit 17e941c563
4 changed files with 10 additions and 18 deletions

@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//components/gcm_driver/config.gni")
buildflag_header("gcm_buildflags") {
@ -105,7 +104,6 @@ static_library("gcm_driver") {
"gcm_stats_recorder_impl.h",
]
deps += [
"//build:chromeos_buildflags",
"//components/crx_file",
"//components/version_info:version_info",
"//google_apis/gcm",
@ -199,9 +197,6 @@ source_set("unit_tests") {
"gcm_stats_recorder_impl_unittest.cc",
]
deps += [
"//build:chromeos_buildflags",
"//components/signin/public/identity_manager:test_support",
]
deps += [ "//components/signin/public/identity_manager:test_support" ]
}
}

@ -11,7 +11,6 @@
#include "base/strings/stringprintf.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -268,7 +267,7 @@ class AccountTrackerTest : public testing::Test {
// the underlying GoogleSignedOut callback is never sent). Tests that exercise
// functionality dependent on that callback firing are not relevant on ChromeOS
// and should simply not run on that platform.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
void NotifyLogoutOfAllAccounts() { identity_test_env_.ClearPrimaryAccount(); }
#endif
@ -310,7 +309,7 @@ TEST_F(AccountTrackerTest, PrimaryNoEventsBeforeLogin) {
NotifyTokenRevoked(account.account_id);
// Logout is not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
NotifyLogoutOfAllAccounts();
#endif
@ -344,7 +343,7 @@ TEST_F(AccountTrackerTest, PrimaryRevokeThenTokenAvailable) {
}
// These tests exercise true login/logout, which are not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(AccountTrackerTest, PrimaryTokenAvailableThenLogin) {
AddAccountWithToken(kPrimaryAccountEmail);
EXPECT_TRUE(observer()->CheckEvents());
@ -457,7 +456,7 @@ TEST_F(AccountTrackerTest, MultiNoEventsBeforeLogin) {
NotifyTokenRevoked(account2.account_id);
// Logout is not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
NotifyLogoutOfAllAccounts();
#endif
@ -524,7 +523,7 @@ TEST_F(AccountTrackerTest, GetAccountsReturnNothingWhenPrimarySignedOut) {
}
// This test exercises true login/logout, which are not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(AccountTrackerTest, MultiLogoutRemovesAllAccounts) {
CoreAccountInfo primary_account = SetActiveAccount(kPrimaryAccountEmail);
NotifyTokenAvailable(primary_account.account_id);

@ -12,7 +12,6 @@
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.h"
#include "components/gcm_driver/fake_gcm_driver.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "google_apis/gaia/google_service_auth_error.h"
@ -347,7 +346,7 @@ TEST_F(GCMAccountTrackerTest, AccountRemoved) {
VerifyAccountTokens(expected_accounts, driver()->accounts());
}
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
// Tests that clearing the primary account when having multiple accounts
// does not crash the application.
// Regression test for crbug.com/1234406
@ -368,7 +367,7 @@ TEST_F(GCMAccountTrackerTest, AccountRemovedWithoutSyncConsentNoCrash) {
ClearPrimaryAccount();
EXPECT_TRUE(driver()->update_accounts_called());
}
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#endif // !BUILDFLAG(IS_CHROMEOS)
TEST_F(GCMAccountTrackerTest, GetTokenFailed) {
CoreAccountInfo account1 = SetPrimaryAccount(kEmail1);

@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/gcm_driver/gcm_driver_desktop.h"
@ -31,9 +30,9 @@ GCMClient::ChromePlatform GetPlatform() {
return GCMClient::PLATFORM_IOS;
#elif BUILDFLAG(IS_ANDROID)
return GCMClient::PLATFORM_ANDROID;
#elif BUILDFLAG(IS_CHROMEOS_ASH)
#elif BUILDFLAG(IS_CHROMEOS)
return GCMClient::PLATFORM_CROS;
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#elif BUILDFLAG(IS_LINUX)
return GCMClient::PLATFORM_LINUX;
#else
// For all other platforms, return as LINUX.