Commit 625baf57 authored by Richard Knoll's avatar Richard Knoll Committed by Commit Bot

Cleanup Unido features that are enabled by default

Removes these flags as they are enabled by default on stable already
and we won't disable them anymore:
 - ClickToCallContextMenuForSelectedText
 - SharingDeviceRegistration
 - ClickToCallOpenDialerDirectly
The ClickToCallReceiver feature is kept as a kill switch but the chrome
flags entry for it is removed.

Bug: None
Change-Id: I05a5f10325176c56ecaaf6419d3c876675eced3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1926627
Commit-Queue: Richard Knoll <knollr@chromium.org>
Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717678}
parent 828cde6a
...@@ -209,7 +209,6 @@ public abstract class ChromeFeatureList { ...@@ -209,7 +209,6 @@ public abstract class ChromeFeatureList {
public static final String CHROME_SHARING_HUB = "ChromeSharingHub"; public static final String CHROME_SHARING_HUB = "ChromeSharingHub";
public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection"; public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection";
public static final String CLEAR_OLD_BROWSING_DATA = "ClearOldBrowsingData"; public static final String CLEAR_OLD_BROWSING_DATA = "ClearOldBrowsingData";
public static final String CLICK_TO_CALL_OPEN_DIALER_DIRECTLY = "ClickToCallOpenDialerDirectly";
public static final String COMMAND_LINE_ON_NON_ROOTED = "CommandLineOnNonRooted"; public static final String COMMAND_LINE_ON_NON_ROOTED = "CommandLineOnNonRooted";
public static final String CONTACTS_PICKER_SELECT_ALL = "ContactsPickerSelectAll"; public static final String CONTACTS_PICKER_SELECT_ALL = "ContactsPickerSelectAll";
public static final String CONTENT_SUGGESTIONS_SCROLL_TO_LOAD = public static final String CONTENT_SUGGESTIONS_SCROLL_TO_LOAD =
......
...@@ -121,7 +121,6 @@ public class FeatureUtilities { ...@@ -121,7 +121,6 @@ public class FeatureUtilities {
cacheSwapPixelFormatToFixConvertFromTranslucentEnabled(); cacheSwapPixelFormatToFixConvertFromTranslucentEnabled();
cacheReachedCodeProfilerTrialGroup(); cacheReachedCodeProfilerTrialGroup();
cacheStartSurfaceEnabled(); cacheStartSurfaceEnabled();
cacheClickToCallOpenDialerDirectlyEnabled();
cacheMarkHttpAsDangerWarningEnabled(); cacheMarkHttpAsDangerWarningEnabled();
if (isHighEndPhone()) cacheGridTabSwitcherEnabled(); if (isHighEndPhone()) cacheGridTabSwitcherEnabled();
...@@ -557,32 +556,6 @@ public class FeatureUtilities { ...@@ -557,32 +556,6 @@ public class FeatureUtilities {
ChromeFeatureList.SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT); ChromeFeatureList.SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT);
} }
/**
* Cache the value of the flag whether or not to directly open the dialer for click to call.
*/
public static void cacheClickToCallOpenDialerDirectlyEnabled() {
cacheFlag(ChromePreferenceKeys.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY,
ChromeFeatureList.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY);
}
/**
* @return Whether or not we should directly open dialer for click to call (based on the cached
* value in SharedPrefs).
*/
public static boolean isClickToCallOpenDialerDirectlyEnabled() {
return isFlagEnabled(ChromePreferenceKeys.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, false);
}
/**
* Toggles whether experiment for opening dialer directly in click to call is enabled for
* testing. Should be reset back to null after the test has finished.
*/
@VisibleForTesting
public static void setIsClickToCallOpenDialerDirectlyEnabledForTesting(
@Nullable Boolean isEnabled) {
sFlags.put(ChromePreferenceKeys.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, isEnabled);
}
/** /**
* Cache the value of the flag of whether to use the grey triangle security indicator on * Cache the value of the flag of whether to use the grey triangle security indicator on
* insecure pages. * insecure pages.
......
...@@ -20,7 +20,6 @@ import org.chromium.base.ContextUtils; ...@@ -20,7 +20,6 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.DeviceConditions; import org.chromium.chrome.browser.DeviceConditions;
import org.chromium.chrome.browser.flags.FeatureUtilities;
import org.chromium.chrome.browser.notifications.NotificationConstants; import org.chromium.chrome.browser.notifications.NotificationConstants;
import org.chromium.chrome.browser.notifications.NotificationUmaTracker; import org.chromium.chrome.browser.notifications.NotificationUmaTracker;
import org.chromium.chrome.browser.notifications.PendingIntentProvider; import org.chromium.chrome.browser.notifications.PendingIntentProvider;
...@@ -129,10 +128,6 @@ public class ClickToCallMessageHandler { ...@@ -129,10 +128,6 @@ public class ClickToCallMessageHandler {
* Returns true if we should open the dialer straight away. * Returns true if we should open the dialer straight away.
*/ */
private static boolean shouldOpenDialer() { private static boolean shouldOpenDialer() {
if (!FeatureUtilities.isClickToCallOpenDialerDirectlyEnabled()) {
return false;
}
// On Android Q and above, we never open the dialer directly. // On Android Q and above, we never open the dialer directly.
if (BuildInfo.isAtLeastQ()) { if (BuildInfo.isAtLeastQ()) {
return false; return false;
...@@ -155,10 +150,6 @@ public class ClickToCallMessageHandler { ...@@ -155,10 +150,6 @@ public class ClickToCallMessageHandler {
* Returns true if we should show notification to the user. * Returns true if we should show notification to the user.
*/ */
private static boolean shouldShowNotification() { private static boolean shouldShowNotification() {
if (!FeatureUtilities.isClickToCallOpenDialerDirectlyEnabled()) {
return true;
}
// Always show the notification for Android Q and above. For pre-Q, only show notification // Always show the notification for Android Q and above. For pre-Q, only show notification
// if device is locked. // if device is locked.
return BuildInfo.isAtLeastQ() return BuildInfo.isAtLeastQ()
......
...@@ -11,10 +11,7 @@ import android.app.NotificationManager; ...@@ -11,10 +11,7 @@ import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment; import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config; import org.robolectric.annotation.Config;
...@@ -25,8 +22,6 @@ import org.chromium.base.test.BaseRobolectricTestRunner; ...@@ -25,8 +22,6 @@ import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.DeviceConditions; import org.chromium.chrome.browser.DeviceConditions;
import org.chromium.chrome.browser.ShadowDeviceConditions; import org.chromium.chrome.browser.ShadowDeviceConditions;
import org.chromium.chrome.browser.flags.FeatureUtilities;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.net.ConnectionType; import org.chromium.net.ConnectionType;
/** /**
...@@ -36,36 +31,12 @@ import org.chromium.net.ConnectionType; ...@@ -36,36 +31,12 @@ import org.chromium.net.ConnectionType;
@RunWith(BaseRobolectricTestRunner.class) @RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE, shadows = {ShadowDeviceConditions.class}) @Config(manifest = Config.NONE, shadows = {ShadowDeviceConditions.class})
public class ClickToCallMessageHandlerTest { public class ClickToCallMessageHandlerTest {
@Rule
public TestRule mProcessor = new Features.JUnitProcessor();
@After
public void tearDown() {
FeatureUtilities.setIsClickToCallOpenDialerDirectlyEnabledForTesting(null);
}
/**
* Disabling the flag to directly open the dialer should force us to display a notification.
*/
@Test
@Feature({"Browser", "Sharing", "ClickToCall"})
public void testHandleMessage_disabledFlagShouldDisplayNotification() {
FeatureUtilities.setIsClickToCallOpenDialerDirectlyEnabledForTesting(false);
setAtLeastAndroidQ(false);
setIsScreenOnAndUnlocked(true);
ClickToCallMessageHandler.handleMessage("18004444444");
assertEquals(1, getShadowNotificationManager().size());
}
/** /**
* Android Q+ should always display a notification to open the dialer. * Android Q+ should always display a notification to open the dialer.
*/ */
@Test @Test
@Feature({"Browser", "Sharing", "ClickToCall"}) @Feature({"Browser", "Sharing", "ClickToCall"})
public void testHandleMessage_androidQShouldDisplayNotification() { public void testHandleMessage_androidQShouldDisplayNotification() {
FeatureUtilities.setIsClickToCallOpenDialerDirectlyEnabledForTesting(true);
setAtLeastAndroidQ(true); setAtLeastAndroidQ(true);
setIsScreenOnAndUnlocked(true); setIsScreenOnAndUnlocked(true);
...@@ -80,7 +51,6 @@ public class ClickToCallMessageHandlerTest { ...@@ -80,7 +51,6 @@ public class ClickToCallMessageHandlerTest {
@Test @Test
@Feature({"Browser", "Sharing", "ClickToCall"}) @Feature({"Browser", "Sharing", "ClickToCall"})
public void testHandleMessage_lockedScreenShouldDisplayNotification() { public void testHandleMessage_lockedScreenShouldDisplayNotification() {
FeatureUtilities.setIsClickToCallOpenDialerDirectlyEnabledForTesting(true);
setAtLeastAndroidQ(false); setAtLeastAndroidQ(false);
setIsScreenOnAndUnlocked(false); setIsScreenOnAndUnlocked(false);
...@@ -96,7 +66,6 @@ public class ClickToCallMessageHandlerTest { ...@@ -96,7 +66,6 @@ public class ClickToCallMessageHandlerTest {
@Test @Test
@Feature({"Browser", "Sharing", "ClickToCall"}) @Feature({"Browser", "Sharing", "ClickToCall"})
public void testHandleMessage_opensDialerDirectly() { public void testHandleMessage_opensDialerDirectly() {
FeatureUtilities.setIsClickToCallOpenDialerDirectlyEnabledForTesting(true);
setAtLeastAndroidQ(false); setAtLeastAndroidQ(false);
setIsScreenOnAndUnlocked(true); setIsScreenOnAndUnlocked(true);
......
...@@ -3773,23 +3773,7 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -3773,23 +3773,7 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(app_list_features::kEnableAssistantLauncherUI)}, FEATURE_VALUE_TYPE(app_list_features::kEnableAssistantLauncherUI)},
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
#if defined(OS_ANDROID)
{"click-to-call-open-dialer-directly",
flag_descriptions::kClickToCallOpenDialerDirectlyName,
flag_descriptions::kClickToCallOpenDialerDirectlyDescription, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kClickToCallOpenDialerDirectly)},
{"click-to-call-receiver", flag_descriptions::kClickToCallReceiverName,
flag_descriptions::kClickToCallReceiverDescription, kOsAndroid,
FEATURE_VALUE_TYPE(kClickToCallReceiver)},
#endif // defined(OS_ANDROID)
#if BUILDFLAG(ENABLE_CLICK_TO_CALL) #if BUILDFLAG(ENABLE_CLICK_TO_CALL)
{"click-to-call-context-menu-selected-text",
flag_descriptions::kClickToCallContextMenuForSelectedTextName,
flag_descriptions::kClickToCallContextMenuForSelectedTextDescription,
kOsDesktop, FEATURE_VALUE_TYPE(kClickToCallContextMenuForSelectedText)},
{"click-to-call-ui", flag_descriptions::kClickToCallUIName, {"click-to-call-ui", flag_descriptions::kClickToCallUIName,
flag_descriptions::kClickToCallUIDescription, kOsDesktop, flag_descriptions::kClickToCallUIDescription, kOsDesktop,
FEATURE_VALUE_TYPE(kClickToCallUI)}, FEATURE_VALUE_TYPE(kClickToCallUI)},
...@@ -3841,11 +3825,6 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -3841,11 +3825,6 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(data_reduction_proxy::features:: FEATURE_VALUE_TYPE(data_reduction_proxy::features::
kDataReductionProxyEnabledWithNetworkService)}, kDataReductionProxyEnabledWithNetworkService)},
{"enable-sharing-device-registration",
flag_descriptions::kSharingDeviceRegistrationName,
flag_descriptions::kSharingDeviceRegistrationDescription, kOsAll,
FEATURE_VALUE_TYPE(kSharingDeviceRegistration)},
{"sharing-derive-vapid-key", flag_descriptions::kSharingDeriveVapidKeyName, {"sharing-derive-vapid-key", flag_descriptions::kSharingDeriveVapidKeyName,
flag_descriptions::kSharingDeriveVapidKeyDescription, kOsAll, flag_descriptions::kSharingDeriveVapidKeyDescription, kOsAll,
FEATURE_VALUE_TYPE(kSharingDeriveVapidKey)}, FEATURE_VALUE_TYPE(kSharingDeriveVapidKey)},
......
...@@ -121,7 +121,6 @@ const base::Feature* kFeaturesExposedToJava[] = { ...@@ -121,7 +121,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
&kChromeDuetLabeled, &kChromeDuetLabeled,
&kChromeSharingHub, &kChromeSharingHub,
&kChromeSmartSelection, &kChromeSmartSelection,
&kClickToCallOpenDialerDirectly,
&kCommandLineOnNonRooted, &kCommandLineOnNonRooted,
&kContactsPickerSelectAll, &kContactsPickerSelectAll,
&kContentSuggestionsScrollToLoad, &kContentSuggestionsScrollToLoad,
...@@ -359,9 +358,6 @@ const base::Feature kChromeSharingHub{"ChromeSharingHub", ...@@ -359,9 +358,6 @@ const base::Feature kChromeSharingHub{"ChromeSharingHub",
const base::Feature kChromeSmartSelection{"ChromeSmartSelection", const base::Feature kChromeSmartSelection{"ChromeSmartSelection",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kClickToCallOpenDialerDirectly{
"ClickToCallOpenDialerDirectly", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCommandLineOnNonRooted{"CommandLineOnNonRooted", const base::Feature kCommandLineOnNonRooted{"CommandLineOnNonRooted",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -49,7 +49,6 @@ extern const base::Feature kDontAutoHideBrowserControls; ...@@ -49,7 +49,6 @@ extern const base::Feature kDontAutoHideBrowserControls;
extern const base::Feature kChromeDuetLabeled; extern const base::Feature kChromeDuetLabeled;
extern const base::Feature kChromeSharingHub; extern const base::Feature kChromeSharingHub;
extern const base::Feature kChromeSmartSelection; extern const base::Feature kChromeSmartSelection;
extern const base::Feature kClickToCallOpenDialerDirectly;
extern const base::Feature kCommandLineOnNonRooted; extern const base::Feature kCommandLineOnNonRooted;
extern const base::Feature kContactsPickerSelectAll; extern const base::Feature kContactsPickerSelectAll;
extern const base::Feature kContextMenuSearchWithGoogleLens; extern const base::Feature kContextMenuSearchWithGoogleLens;
......
...@@ -1876,12 +1876,6 @@ const char kSharedClipboardUIDescription[] = ...@@ -1876,12 +1876,6 @@ const char kSharedClipboardUIDescription[] =
"Enables shared clipboard feature signals to be handled by showing " "Enables shared clipboard feature signals to be handled by showing "
"a list of user's available devices to share the clipboard."; "a list of user's available devices to share the clipboard.";
const char kSharingDeviceRegistrationName[] =
"Enable device registration for Sharing features";
const char kSharingDeviceRegistrationDescription[] =
"Enables device registration with Sharing infrastructure. Required to use "
"cross-device Sharing features.";
const char kSharingPeerConnectionReceiverName[] = const char kSharingPeerConnectionReceiverName[] =
"Enable receiver device to handle peer connection requests."; "Enable receiver device to handle peer connection requests.";
const char kSharingPeerConnectionReceiverDescription[] = const char kSharingPeerConnectionReceiverDescription[] =
...@@ -2466,23 +2460,12 @@ const char kClearOldBrowsingDataDescription[] = ...@@ -2466,23 +2460,12 @@ const char kClearOldBrowsingDataDescription[] =
"Enables clearing of browsing data which is older than a given time " "Enables clearing of browsing data which is older than a given time "
"period."; "period.";
const char kClickToCallOpenDialerDirectlyName[] =
"Open the dialer directly for Click to Call";
const char kClickToCallOpenDialerDirectlyDescription[] =
"Enables opening the dialer directly instead of displaying a notification. "
"Only available on Android P- and when the screen is on and unlocked.";
const char kCloseTabSuggestionsName[] = "Suggest to close Tabs"; const char kCloseTabSuggestionsName[] = "Suggest to close Tabs";
const char kCloseTabSuggestionsDescription[] = const char kCloseTabSuggestionsDescription[] =
"Suggests to the user to close Tabs that haven't been used beyond a " "Suggests to the user to close Tabs that haven't been used beyond a "
"configurable threshold or where duplicates of Tabs exist. " "configurable threshold or where duplicates of Tabs exist. "
"The threshold is configurable."; "The threshold is configurable.";
const char kClickToCallReceiverName[] =
"Enable receiver device to handle click to call feature";
const char kClickToCallReceiverDescription[] =
"Enables receiver device to handle click to call feature by showing a "
"notification to call the phone number clicked on the desktop.";
const char kContextualSearchDefinitionsName[] = "Contextual Search definitions"; const char kContextualSearchDefinitionsName[] = "Contextual Search definitions";
const char kContextualSearchDefinitionsDescription[] = const char kContextualSearchDefinitionsDescription[] =
"Enables tap-activated contextual definitions of words on a page to be " "Enables tap-activated contextual definitions of words on a page to be "
...@@ -3914,12 +3897,6 @@ const char kWebGL2ComputeContextDescription[] = ...@@ -3914,12 +3897,6 @@ const char kWebGL2ComputeContextDescription[] =
#if BUILDFLAG(ENABLE_CLICK_TO_CALL) #if BUILDFLAG(ENABLE_CLICK_TO_CALL)
const char kClickToCallContextMenuForSelectedTextName[] =
"Enable click to call feature on desktop when a phone number is selected";
const char kClickToCallContextMenuForSelectedTextDescription[] =
"Enables click to call feature to be shown in context menu when the user "
"right clicks after selecting a phone number.";
const char kClickToCallUIName[] = const char kClickToCallUIName[] =
"Enable click to call feature signals to be handled on desktop"; "Enable click to call feature signals to be handled on desktop";
const char kClickToCallUIDescription[] = const char kClickToCallUIDescription[] =
......
...@@ -1102,9 +1102,6 @@ extern const char kSharedClipboardReceiverDescription[]; ...@@ -1102,9 +1102,6 @@ extern const char kSharedClipboardReceiverDescription[];
extern const char kSharedClipboardUIName[]; extern const char kSharedClipboardUIName[];
extern const char kSharedClipboardUIDescription[]; extern const char kSharedClipboardUIDescription[];
extern const char kSharingDeviceRegistrationName[];
extern const char kSharingDeviceRegistrationDescription[];
extern const char kSharingPeerConnectionReceiverName[]; extern const char kSharingPeerConnectionReceiverName[];
extern const char kSharingPeerConnectionReceiverDescription[]; extern const char kSharingPeerConnectionReceiverDescription[];
...@@ -1457,15 +1454,9 @@ extern const char kChromeSharingHubDescription[]; ...@@ -1457,15 +1454,9 @@ extern const char kChromeSharingHubDescription[];
extern const char kClearOldBrowsingDataName[]; extern const char kClearOldBrowsingDataName[];
extern const char kClearOldBrowsingDataDescription[]; extern const char kClearOldBrowsingDataDescription[];
extern const char kClickToCallOpenDialerDirectlyName[];
extern const char kClickToCallOpenDialerDirectlyDescription[];
extern const char kCloseTabSuggestionsName[]; extern const char kCloseTabSuggestionsName[];
extern const char kCloseTabSuggestionsDescription[]; extern const char kCloseTabSuggestionsDescription[];
extern const char kClickToCallReceiverName[];
extern const char kClickToCallReceiverDescription[];
extern const char kContextualSearchDefinitionsName[]; extern const char kContextualSearchDefinitionsName[];
extern const char kContextualSearchDefinitionsDescription[]; extern const char kContextualSearchDefinitionsDescription[];
...@@ -2339,9 +2330,6 @@ extern const char kWebGL2ComputeContextDescription[]; ...@@ -2339,9 +2330,6 @@ extern const char kWebGL2ComputeContextDescription[];
#if BUILDFLAG(ENABLE_CLICK_TO_CALL) #if BUILDFLAG(ENABLE_CLICK_TO_CALL)
extern const char kClickToCallContextMenuForSelectedTextName[];
extern const char kClickToCallContextMenuForSelectedTextDescription[];
extern const char kClickToCallUIName[]; extern const char kClickToCallUIName[];
extern const char kClickToCallUIDescription[]; extern const char kClickToCallUIDescription[];
......
...@@ -347,13 +347,6 @@ public final class ChromePreferenceKeys { ...@@ -347,13 +347,6 @@ public final class ChromePreferenceKeys {
public static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT = public static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT =
"swap_pixel_format_to_fix_convert_from_translucent"; "swap_pixel_format_to_fix_convert_from_translucent";
/**
* Whether or not we should directly open the dialer when a click to call notification is
* received. Default value is false.
*/
public static final String CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY =
"click_to_call_open_dialer_directly";
@CheckDiscard("Validation is performed in tests and in debug builds.") @CheckDiscard("Validation is performed in tests and in debug builds.")
static List<String> createUsedKeys() { static List<String> createUsedKeys() {
// These values are currently used as SharedPreferences keys. // These values are currently used as SharedPreferences keys.
...@@ -433,8 +426,7 @@ public final class ChromePreferenceKeys { ...@@ -433,8 +426,7 @@ public final class ChromePreferenceKeys {
PRIORITIZE_BOOTSTRAP_TASKS_KEY, PRIORITIZE_BOOTSTRAP_TASKS_KEY,
NETWORK_SERVICE_WARM_UP_ENABLED_KEY, NETWORK_SERVICE_WARM_UP_ENABLED_KEY,
IMMERSIVE_UI_MODE_ENABLED, IMMERSIVE_UI_MODE_ENABLED,
SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT
CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY
); );
// clang-format on // clang-format on
} }
...@@ -462,7 +454,8 @@ public final class ChromePreferenceKeys { ...@@ -462,7 +454,8 @@ public final class ChromePreferenceKeys {
"chrome_home_opt_out_snackbar_shown", "chrome_home_opt_out_snackbar_shown",
"chrome_home_info_promo_shown", "chrome_home_info_promo_shown",
"chrome_home_enabled_date", "chrome_home_enabled_date",
"PrefMigrationVersion" "PrefMigrationVersion",
"click_to_call_open_dialer_directly"
); );
// clang-format on // clang-format on
} }
...@@ -543,8 +536,7 @@ public final class ChromePreferenceKeys { ...@@ -543,8 +536,7 @@ public final class ChromePreferenceKeys {
PRIORITIZE_BOOTSTRAP_TASKS_KEY, PRIORITIZE_BOOTSTRAP_TASKS_KEY,
NETWORK_SERVICE_WARM_UP_ENABLED_KEY, NETWORK_SERVICE_WARM_UP_ENABLED_KEY,
IMMERSIVE_UI_MODE_ENABLED, IMMERSIVE_UI_MODE_ENABLED,
SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT
CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY
); );
// clang-format on // clang-format on
} }
......
...@@ -71,10 +71,8 @@ base::Optional<std::string> ExtractPhoneNumberForClickToCall( ...@@ -71,10 +71,8 @@ base::Optional<std::string> ExtractPhoneNumberForClickToCall(
if (selection_text.size() > kSelectionTextMaxLength) if (selection_text.size() > kSelectionTextMaxLength)
return base::nullopt; return base::nullopt;
if (!base::FeatureList::IsEnabled(kClickToCallContextMenuForSelectedText) || if (!IsClickToCallEnabled(browser_context))
!IsClickToCallEnabled(browser_context)) {
return base::nullopt; return base::nullopt;
}
return ExtractPhoneNumber(selection_text, PhoneNumberRegexVariant::kSimple); return ExtractPhoneNumber(selection_text, PhoneNumberRegexVariant::kSimple);
} }
......
...@@ -83,31 +83,27 @@ class ClickToCallUtilsTest : public testing::Test { ...@@ -83,31 +83,27 @@ class ClickToCallUtilsTest : public testing::Test {
} // namespace } // namespace
TEST_F(ClickToCallUtilsTest, NoSharingService_DoNotOfferAnyMenu) { TEST_F(ClickToCallUtilsTest, NoSharingService_DoNotOfferAnyMenu) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallUI, kClickToCallContextMenuForSelectedText}, {});
create_service_ = false; create_service_ = false;
EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl))); EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl)));
ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber); ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber);
} }
TEST_F(ClickToCallUtilsTest, UIFlagDisabled_DoNotOfferAnyMenu) { TEST_F(ClickToCallUtilsTest, UIFlagDisabled_DoNotOfferAnyMenu) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndDisableFeature(kClickToCallUI);
{kClickToCallContextMenuForSelectedText}, {kClickToCallUI});
EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl))); EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl)));
ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber); ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber);
} }
TEST_F(ClickToCallUtilsTest, PolicyDisabled_DoNotOfferAnyMenu) { TEST_F(ClickToCallUtilsTest, PolicyDisabled_DoNotOfferAnyMenu) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallContextMenuForSelectedText, kClickToCallUI}, {});
profile_.GetPrefs()->SetBoolean(prefs::kClickToCallEnabled, false); profile_.GetPrefs()->SetBoolean(prefs::kClickToCallEnabled, false);
EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl))); EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kTelUrl)));
ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber); ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber);
} }
TEST_F(ClickToCallUtilsTest, IncognitoProfile_DoNotOfferAnyMenu) { TEST_F(ClickToCallUtilsTest, IncognitoProfile_DoNotOfferAnyMenu) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallUI, kClickToCallContextMenuForSelectedText}, {});
EXPECT_FALSE(ShouldOfferClickToCallForURL(profile_.GetOffTheRecordProfile(), EXPECT_FALSE(ShouldOfferClickToCallForURL(profile_.GetOffTheRecordProfile(),
GURL(kTelUrl))); GURL(kTelUrl)));
ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber, ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber,
...@@ -129,17 +125,9 @@ TEST_F(ClickToCallUtilsTest, NonTelLink_DoNotOfferForLink) { ...@@ -129,17 +125,9 @@ TEST_F(ClickToCallUtilsTest, NonTelLink_DoNotOfferForLink) {
EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kNonTelUrl))); EXPECT_FALSE(ShouldOfferClickToCallForURL(&profile_, GURL(kNonTelUrl)));
} }
TEST_F(ClickToCallUtilsTest,
SelectionTextWithNumber_ContextMenuFlagDisabled_DoNotOfferForSelection) {
scoped_feature_list_.InitWithFeatures(
{kClickToCallUI}, {kClickToCallContextMenuForSelectedText});
ExpectClickToCallDisabledForSelectionText(kSelectionTextWithNumber);
}
TEST_F(ClickToCallUtilsTest, TEST_F(ClickToCallUtilsTest,
SelectionText_ValidPhoneNumberRegex_OfferForSelection) { SelectionText_ValidPhoneNumberRegex_OfferForSelection) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallUI, kClickToCallContextMenuForSelectedText}, {});
// Stores a mapping of selected text to expected phone number parsed. // Stores a mapping of selected text to expected phone number parsed.
std::map<std::string, std::string> expectations; std::map<std::string, std::string> expectations;
...@@ -174,8 +162,7 @@ TEST_F(ClickToCallUtilsTest, ...@@ -174,8 +162,7 @@ TEST_F(ClickToCallUtilsTest,
TEST_F(ClickToCallUtilsTest, TEST_F(ClickToCallUtilsTest,
SelectionText_InvalidPhoneNumberRegex_DoNotOfferForSelection) { SelectionText_InvalidPhoneNumberRegex_DoNotOfferForSelection) {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallUI, kClickToCallContextMenuForSelectedText}, {});
std::vector<std::string> invalid_selection_texts; std::vector<std::string> invalid_selection_texts;
// Does not contain any number. // Does not contain any number.
......
...@@ -10,9 +10,6 @@ const base::Feature kClickToCallReceiver{"ClickToCallReceiver", ...@@ -10,9 +10,6 @@ const base::Feature kClickToCallReceiver{"ClickToCallReceiver",
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
#if BUILDFLAG(ENABLE_CLICK_TO_CALL) #if BUILDFLAG(ENABLE_CLICK_TO_CALL)
const base::Feature kClickToCallContextMenuForSelectedText{
"ClickToCallContextMenuForSelectedText", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kClickToCallUI{"ClickToCallUI", const base::Feature kClickToCallUI{"ClickToCallUI",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -18,10 +18,6 @@ extern const base::Feature kClickToCallReceiver; ...@@ -18,10 +18,6 @@ extern const base::Feature kClickToCallReceiver;
// Feature to allow click to call gets processed on desktop. // Feature to allow click to call gets processed on desktop.
extern const base::Feature kClickToCallUI; extern const base::Feature kClickToCallUI;
// Feature to show click to call in context menu when selected text is a phone
// number.
extern const base::Feature kClickToCallContextMenuForSelectedText;
// Feature to use the second version of the phone number detection. // Feature to use the second version of the phone number detection.
extern const base::Feature kClickToCallDetectionV2; extern const base::Feature kClickToCallDetectionV2;
#endif // BUILDFLAG(ENABLE_CLICK_TO_CALL) #endif // BUILDFLAG(ENABLE_CLICK_TO_CALL)
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
#include "chrome/browser/sharing/features.h" #include "chrome/browser/sharing/features.h"
const base::Feature kSharingDeviceRegistration{
"SharingDeviceRegistration", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSharingUseDeviceInfo{"SharingUseDeviceInfo", const base::Feature kSharingUseDeviceInfo{"SharingUseDeviceInfo",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
#include "base/feature_list.h" #include "base/feature_list.h"
// Feature to allow device registration for sharing features.
extern const base::Feature kSharingDeviceRegistration;
// Feature flag to allow sharing infrastructure to register devices in // Feature flag to allow sharing infrastructure to register devices in
// DeviceInfo. // DeviceInfo.
extern const base::Feature kSharingUseDeviceInfo; extern const base::Feature kSharingUseDeviceInfo;
......
...@@ -103,19 +103,9 @@ void SharingService::OnSyncShutdown(syncer::SyncService* sync) { ...@@ -103,19 +103,9 @@ void SharingService::OnSyncShutdown(syncer::SyncService* sync) {
} }
void SharingService::OnStateChanged(syncer::SyncService* sync) { void SharingService::OnStateChanged(syncer::SyncService* sync) {
if (IsSyncEnabledForSharing(sync_service_)) { if (IsSyncEnabledForSharing(sync_service_) && state_ == State::DISABLED) {
if (base::FeatureList::IsEnabled(kSharingDeviceRegistration)) { state_ = State::REGISTERING;
if (state_ == State::DISABLED) { RegisterDevice();
state_ = State::REGISTERING;
RegisterDevice();
}
} else {
// Unregister the device once and stop listening for sync state changes.
// If feature is turned back on, Chrome needs to be restarted.
if (sync_service_ && sync_service_->HasObserver(this))
sync_service_->RemoveObserver(this);
UnregisterDevice();
}
} else if (IsSyncDisabledForSharing(sync_service_) && } else if (IsSyncDisabledForSharing(sync_service_) &&
state_ == State::ACTIVE) { state_ == State::ACTIVE) {
state_ = State::UNREGISTERING; state_ = State::UNREGISTERING;
...@@ -214,8 +204,7 @@ void SharingService::OnDeviceRegistered( ...@@ -214,8 +204,7 @@ void SharingService::OnDeviceRegistered(
void SharingService::OnDeviceUnregistered( void SharingService::OnDeviceUnregistered(
SharingDeviceRegistrationResult result) { SharingDeviceRegistrationResult result) {
LogSharingUnegistrationResult(result); LogSharingUnegistrationResult(result);
if (IsSyncEnabledForSharing(sync_service_) && if (IsSyncEnabledForSharing(sync_service_)) {
base::FeatureList::IsEnabled(kSharingDeviceRegistration)) {
// In case sync is enabled during un-registration, register it. // In case sync is enabled during un-registration, register it.
state_ = State::REGISTERING; state_ = State::REGISTERING;
RegisterDevice(); RegisterDevice();
......
...@@ -343,8 +343,6 @@ TEST_F(SharingServiceTest, SendMessageToDeviceSuccess) { ...@@ -343,8 +343,6 @@ TEST_F(SharingServiceTest, SendMessageToDeviceSuccess) {
} }
TEST_F(SharingServiceTest, DeviceRegistration) { TEST_F(SharingServiceTest, DeviceRegistration) {
// Enable the feature.
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
test_sync_service_.SetActiveDataTypes( test_sync_service_.SetActiveDataTypes(
...@@ -383,8 +381,6 @@ TEST_F(SharingServiceTest, DeviceRegistration) { ...@@ -383,8 +381,6 @@ TEST_F(SharingServiceTest, DeviceRegistration) {
} }
TEST_F(SharingServiceTest, DeviceRegistrationPreferenceNotAvailable) { TEST_F(SharingServiceTest, DeviceRegistrationPreferenceNotAvailable) {
// Enable the feature.
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
test_sync_service_.SetActiveDataTypes(syncer::DEVICE_INFO); test_sync_service_.SetActiveDataTypes(syncer::DEVICE_INFO);
...@@ -401,10 +397,9 @@ TEST_F(SharingServiceTest, DeviceRegistrationPreferenceNotAvailable) { ...@@ -401,10 +397,9 @@ TEST_F(SharingServiceTest, DeviceRegistrationPreferenceNotAvailable) {
} }
TEST_F(SharingServiceTest, DeviceRegistrationTransportMode) { TEST_F(SharingServiceTest, DeviceRegistrationTransportMode) {
// Enable the registration feature and transport mode required features. // Enable the transport mode required features.
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{kSharingDeviceRegistration, kSharingUseDeviceInfo, /*enabled_features=*/{kSharingUseDeviceInfo, kSharingDeriveVapidKey},
kSharingDeriveVapidKey},
/*disabled_features=*/{}); /*disabled_features=*/{});
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
...@@ -435,8 +430,6 @@ TEST_F(SharingServiceTest, DeviceRegistrationTransportMode) { ...@@ -435,8 +430,6 @@ TEST_F(SharingServiceTest, DeviceRegistrationTransportMode) {
} }
TEST_F(SharingServiceTest, DeviceRegistrationTransientError) { TEST_F(SharingServiceTest, DeviceRegistrationTransientError) {
// Enable the feature.
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
test_sync_service_.SetActiveDataTypes( test_sync_service_.SetActiveDataTypes(
...@@ -465,30 +458,7 @@ TEST_F(SharingServiceTest, DeviceRegistrationTransientError) { ...@@ -465,30 +458,7 @@ TEST_F(SharingServiceTest, DeviceRegistrationTransientError) {
GetSharingService()->GetStateForTesting()); GetSharingService()->GetStateForTesting());
} }
TEST_F(SharingServiceTest, DeviceUnregistrationFeatureDisabled) {
scoped_feature_list_.InitAndDisableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE);
sharing_device_registration_->SetResult(
SharingDeviceRegistrationResult::kSuccess);
EXPECT_EQ(SharingService::State::DISABLED,
GetSharingService()->GetStateForTesting());
test_sync_service_.FireStateChanged();
EXPECT_EQ(1, sharing_device_registration_->unregistration_attempts());
EXPECT_EQ(SharingService::State::DISABLED,
GetSharingService()->GetStateForTesting());
// Further state changes are ignored.
test_sync_service_.FireStateChanged();
EXPECT_EQ(1, sharing_device_registration_->unregistration_attempts());
EXPECT_EQ(SharingService::State::DISABLED,
GetSharingService()->GetStateForTesting());
}
TEST_F(SharingServiceTest, DeviceUnregistrationSyncDisabled) { TEST_F(SharingServiceTest, DeviceUnregistrationSyncDisabled) {
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::DISABLED); syncer::SyncService::TransportState::DISABLED);
...@@ -500,10 +470,9 @@ TEST_F(SharingServiceTest, DeviceUnregistrationSyncDisabled) { ...@@ -500,10 +470,9 @@ TEST_F(SharingServiceTest, DeviceUnregistrationSyncDisabled) {
} }
TEST_F(SharingServiceTest, DeviceUnregistrationLocalSyncEnabled) { TEST_F(SharingServiceTest, DeviceUnregistrationLocalSyncEnabled) {
// Enable the registration feature and transport mode required features. // Enable the transport mode required features.
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{kSharingDeviceRegistration, kSharingUseDeviceInfo, /*enabled_features=*/{kSharingUseDeviceInfo, kSharingDeriveVapidKey},
kSharingDeriveVapidKey},
/*disabled_features=*/{}); /*disabled_features=*/{});
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
...@@ -518,8 +487,6 @@ TEST_F(SharingServiceTest, DeviceUnregistrationLocalSyncEnabled) { ...@@ -518,8 +487,6 @@ TEST_F(SharingServiceTest, DeviceUnregistrationLocalSyncEnabled) {
} }
TEST_F(SharingServiceTest, DeviceRegisterAndUnregister) { TEST_F(SharingServiceTest, DeviceRegisterAndUnregister) {
// Enable the feature.
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
test_sync_service_.SetActiveDataTypes( test_sync_service_.SetActiveDataTypes(
...@@ -596,7 +563,6 @@ TEST_F(SharingServiceTest, DeviceRegisterAndUnregister) { ...@@ -596,7 +563,6 @@ TEST_F(SharingServiceTest, DeviceRegisterAndUnregister) {
} }
TEST_F(SharingServiceTest, StartListeningToFCMAtConstructor) { TEST_F(SharingServiceTest, StartListeningToFCMAtConstructor) {
scoped_feature_list_.InitAndEnableFeature(kSharingDeviceRegistration);
test_sync_service_.SetTransportState( test_sync_service_.SetTransportState(
syncer::SyncService::TransportState::ACTIVE); syncer::SyncService::TransportState::ACTIVE);
test_sync_service_.SetActiveDataTypes( test_sync_service_.SetActiveDataTypes(
......
...@@ -51,11 +51,13 @@ enum class ClickToCallPolicy { ...@@ -51,11 +51,13 @@ enum class ClickToCallPolicy {
} // namespace } // namespace
// Browser tests for the Click To Call feature. // Browser tests for the Click To Call feature.
class ClickToCallBrowserTestBase : public SharingBrowserTest { class ClickToCallBrowserTest : public SharingBrowserTest {
public: public:
ClickToCallBrowserTestBase() {} ClickToCallBrowserTest() {
feature_list_.InitAndEnableFeature(kClickToCallUI);
}
~ClickToCallBrowserTestBase() override {} ~ClickToCallBrowserTest() override {}
std::string GetTestPageURL() const override { std::string GetTestPageURL() const override {
return std::string(kTestPageURL); return std::string(kTestPageURL);
...@@ -78,16 +80,7 @@ class ClickToCallBrowserTestBase : public SharingBrowserTest { ...@@ -78,16 +80,7 @@ class ClickToCallBrowserTestBase : public SharingBrowserTest {
} }
private: private:
DISALLOW_COPY_AND_ASSIGN(ClickToCallBrowserTestBase); DISALLOW_COPY_AND_ASSIGN(ClickToCallBrowserTest);
};
class ClickToCallBrowserTest : public ClickToCallBrowserTestBase {
public:
ClickToCallBrowserTest() {
feature_list_.InitWithFeatures({kSharingDeviceRegistration, kClickToCallUI,
kClickToCallContextMenuForSelectedText},
{});
}
}; };
// TODO(himanshujaju): Add UI checks. // TODO(himanshujaju): Add UI checks.
...@@ -325,33 +318,6 @@ IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, ...@@ -325,33 +318,6 @@ IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest,
/*sample=*/9, /*count=*/1); /*sample=*/9, /*count=*/1);
} }
class ClickToCallBrowserTestWithContextMenuDisabled
: public ClickToCallBrowserTestBase {
public:
ClickToCallBrowserTestWithContextMenuDisabled() {
feature_list_.InitWithFeatures({kSharingDeviceRegistration, kClickToCallUI},
{kClickToCallContextMenuForSelectedText});
}
};
IN_PROC_BROWSER_TEST_F(
ClickToCallBrowserTestWithContextMenuDisabled,
ContextMenu_HighlightedText_DevicesAvailable_FeatureFlagOff) {
Init(sync_pb::SharingSpecificFields::CLICK_TO_CALL,
sync_pb::SharingSpecificFields::CLICK_TO_CALL);
auto devices = sharing_service()->GetDeviceCandidates(
sync_pb::SharingSpecificFields::CLICK_TO_CALL);
ASSERT_EQ(2u, devices.size());
std::unique_ptr<TestRenderViewContextMenu> menu =
InitContextMenu(GURL(kNonTelUrl), kLinkText, kTextWithPhoneNumber);
EXPECT_FALSE(menu->IsItemPresent(
IDC_CONTENT_CONTEXT_SHARING_CLICK_TO_CALL_SINGLE_DEVICE));
EXPECT_FALSE(menu->IsItemPresent(
IDC_CONTENT_CONTEXT_SHARING_CLICK_TO_CALL_MULTIPLE_DEVICES));
}
IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, ContextMenu_UKM) { IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, ContextMenu_UKM) {
Init(sync_pb::SharingSpecificFields::CLICK_TO_CALL, Init(sync_pb::SharingSpecificFields::CLICK_TO_CALL,
sync_pb::SharingSpecificFields::UNKNOWN); sync_pb::SharingSpecificFields::UNKNOWN);
...@@ -404,15 +370,6 @@ IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, ContextMenu_UKM) { ...@@ -404,15 +370,6 @@ IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, ContextMenu_UKM) {
// TODO(knollr): mock apps and verify |has_apps| here too. // TODO(knollr): mock apps and verify |has_apps| here too.
} }
class ClickToCallBrowserTestWithContextMenuFeatureDefault
: public ClickToCallBrowserTestBase {
public:
ClickToCallBrowserTestWithContextMenuFeatureDefault() {
feature_list_.InitWithFeatures({kSharingDeviceRegistration, kClickToCallUI},
{});
}
};
IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, CloseTabWithBubble) { IN_PROC_BROWSER_TEST_F(ClickToCallBrowserTest, CloseTabWithBubble) {
Init(sync_pb::SharingSpecificFields::CLICK_TO_CALL, Init(sync_pb::SharingSpecificFields::CLICK_TO_CALL,
sync_pb::SharingSpecificFields::UNKNOWN); sync_pb::SharingSpecificFields::UNKNOWN);
...@@ -441,8 +398,7 @@ class ClickToCallPolicyTest ...@@ -441,8 +398,7 @@ class ClickToCallPolicyTest
public testing::WithParamInterface<ClickToCallPolicy> { public testing::WithParamInterface<ClickToCallPolicy> {
public: public:
ClickToCallPolicyTest() { ClickToCallPolicyTest() {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(kClickToCallUI);
{kClickToCallUI, kClickToCallContextMenuForSelectedText}, {});
} }
~ClickToCallPolicyTest() override = default; ~ClickToCallPolicyTest() override = default;
......
...@@ -55,7 +55,7 @@ class SharedClipboardBrowserTestBase : public SharingBrowserTest { ...@@ -55,7 +55,7 @@ class SharedClipboardBrowserTestBase : public SharingBrowserTest {
class SharedClipboardBrowserTest : public SharedClipboardBrowserTestBase { class SharedClipboardBrowserTest : public SharedClipboardBrowserTestBase {
public: public:
SharedClipboardBrowserTest() { SharedClipboardBrowserTest() {
feature_list_.InitWithFeatures({kSharedClipboardUI}, {}); feature_list_.InitAndEnableFeature(kSharedClipboardUI);
} }
}; };
...@@ -158,7 +158,7 @@ class SharedClipboardUIFeatureDisabledBrowserTest ...@@ -158,7 +158,7 @@ class SharedClipboardUIFeatureDisabledBrowserTest
: public SharedClipboardBrowserTestBase { : public SharedClipboardBrowserTestBase {
public: public:
SharedClipboardUIFeatureDisabledBrowserTest() { SharedClipboardUIFeatureDisabledBrowserTest() {
feature_list_.InitWithFeatures({}, {kSharedClipboardUI}); feature_list_.InitAndDisableFeature(kSharedClipboardUI);
} }
}; };
......
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