Commit 8941d1d5 authored by Azeem Arshad's avatar Azeem Arshad Committed by Commit Bot

[CrOS Cellular] Hide instant tether toggle in mobile data subpage.

The tether toggle is being removed from the mobile data subpage as part
of the updated eSIM UI. See go/chromeos-lte. This CL hides the instant
tethering toggle when UpdatedCellularUI flag is enabled. Additional
subpage changes will be made in followup CLs.

Bug: 1093185
Change-Id: I7f2f01ef18a4e32893ef2289d27ad003a8a20e64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380323
Commit-Queue: Azeem Arshad <azeemarshad@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803676}
parent b4a4c365
...@@ -110,7 +110,9 @@ Polymer({ ...@@ -110,7 +110,9 @@ Polymer({
/** @private */ /** @private */
isUpdatedCellularUiEnabled_: { isUpdatedCellularUiEnabled_: {
type: Boolean, type: Boolean,
value: loadTimeData.getBoolean('updatedCellularActivationUi'), value() {
return loadTimeData.getBoolean('updatedCellularActivationUi');
}
}, },
/** @private */ /** @private */
...@@ -776,6 +778,12 @@ Polymer({ ...@@ -776,6 +778,12 @@ Polymer({
* @private * @private
*/ */
tetherToggleIsVisible_(deviceState, tetherDeviceState) { tetherToggleIsVisible_(deviceState, tetherDeviceState) {
// Do not show instant tether toggle if Updated Cellular UI is enabled.
// This toggle will be removed from the mobile data subpage.
if (this.isUpdatedCellularUiEnabled_) {
return false;
}
return !!deviceState && deviceState.type == mojom.NetworkType.kCellular && return !!deviceState && deviceState.type == mojom.NetworkType.kCellular &&
!!tetherDeviceState; !!tetherDeviceState;
}, },
......
...@@ -43,7 +43,11 @@ suite('InternetSubpage', function() { ...@@ -43,7 +43,11 @@ suite('InternetSubpage', function() {
internetSubpage.deviceState = mojoApi_.getDeviceStateForTest(type); internetSubpage.deviceState = mojoApi_.getDeviceStateForTest(type);
} }
setup(function() { function initSubpage(isUpdatedCellularUiEnabled) {
if (isUpdatedCellularUiEnabled !== undefined) {
loadTimeData.overrideValues(
{updatedCellularActivationUi: !!isUpdatedCellularUiEnabled});
}
PolymerTest.clearBody(); PolymerTest.clearBody();
internetSubpage = document.createElement('settings-internet-subpage'); internetSubpage = document.createElement('settings-internet-subpage');
assertTrue(!!internetSubpage); assertTrue(!!internetSubpage);
...@@ -51,7 +55,7 @@ suite('InternetSubpage', function() { ...@@ -51,7 +55,7 @@ suite('InternetSubpage', function() {
document.body.appendChild(internetSubpage); document.body.appendChild(internetSubpage);
internetSubpage.init(); internetSubpage.init();
return flushAsync(); return flushAsync();
}); }
teardown(function() { teardown(function() {
internetSubpage.remove(); internetSubpage.remove();
...@@ -61,6 +65,7 @@ suite('InternetSubpage', function() { ...@@ -61,6 +65,7 @@ suite('InternetSubpage', function() {
suite('SubPage', function() { suite('SubPage', function() {
test('WiFi', function() { test('WiFi', function() {
initSubpage();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kWiFi, [ setNetworksForTest(mojom.NetworkType.kWiFi, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'), OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'),
...@@ -78,6 +83,7 @@ suite('InternetSubpage', function() { ...@@ -78,6 +83,7 @@ suite('InternetSubpage', function() {
}); });
test('Deep link to WiFi on/off toggle', async () => { test('Deep link to WiFi on/off toggle', async () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kWiFi, [ setNetworksForTest(mojom.NetworkType.kWiFi, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'), OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'),
...@@ -100,6 +106,7 @@ suite('InternetSubpage', function() { ...@@ -100,6 +106,7 @@ suite('InternetSubpage', function() {
}); });
test('Tether', function() { test('Tether', function() {
initSubpage();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kTether, [ setNetworksForTest(mojom.NetworkType.kTether, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'), OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'),
...@@ -121,6 +128,7 @@ suite('InternetSubpage', function() { ...@@ -121,6 +128,7 @@ suite('InternetSubpage', function() {
}); });
test('Deep link to tether on/off toggle w/o cellular', async () => { test('Deep link to tether on/off toggle w/o cellular', async () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kTether, [ setNetworksForTest(mojom.NetworkType.kTether, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'), OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'),
...@@ -147,6 +155,7 @@ suite('InternetSubpage', function() { ...@@ -147,6 +155,7 @@ suite('InternetSubpage', function() {
}); });
test('Fire show cellular setup event on add cellular clicked', () => { test('Fire show cellular setup event on add cellular clicked', () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kCellular); mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kCellular);
setNetworksForTest(mojom.NetworkType.kCellular, [ setNetworksForTest(mojom.NetworkType.kCellular, [
...@@ -173,6 +182,7 @@ suite('InternetSubpage', function() { ...@@ -173,6 +182,7 @@ suite('InternetSubpage', function() {
}); });
test('Tether plus Cellular', function() { test('Tether plus Cellular', function() {
initSubpage(false /* isUpdatedCellularUiEnabled */);
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether); mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether);
setNetworksForTest(mojom.NetworkType.kCellular, [ setNetworksForTest(mojom.NetworkType.kCellular, [
...@@ -200,6 +210,7 @@ suite('InternetSubpage', function() { ...@@ -200,6 +210,7 @@ suite('InternetSubpage', function() {
}); });
test('Deep link to tether on/off toggle w/ cellular', async () => { test('Deep link to tether on/off toggle w/ cellular', async () => {
initSubpage(false /* isUpdatedCellularUiEnabled */);
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether); mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether);
setNetworksForTest(mojom.NetworkType.kCellular, [ setNetworksForTest(mojom.NetworkType.kCellular, [
...@@ -229,10 +240,10 @@ suite('InternetSubpage', function() { ...@@ -229,10 +240,10 @@ suite('InternetSubpage', function() {
}); });
suite('VPN', function() { suite('VPN', function() {
setup(function() { function initVpn() {
addTestVpnProviders(); addTestVpnProviders();
addTestVpnNetworks(); addTestVpnNetworks();
}); }
function addTestVpnProviders() { function addTestVpnProviders() {
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
...@@ -335,6 +346,8 @@ suite('InternetSubpage', function() { ...@@ -335,6 +346,8 @@ suite('InternetSubpage', function() {
} }
test('should update network state list properly', function() { test('should update network state list properly', function() {
initSubpage();
initVpn();
return flushAsync().then(() => { return flushAsync().then(() => {
const allNetworkLists = const allNetworkLists =
internetSubpage.shadowRoot.querySelectorAll('network-list'); internetSubpage.shadowRoot.querySelectorAll('network-list');
...@@ -354,6 +367,8 @@ suite('InternetSubpage', function() { ...@@ -354,6 +367,8 @@ suite('InternetSubpage', function() {
test( test(
'should not show built-in VPN list when device is disabled', 'should not show built-in VPN list when device is disabled',
function() { function() {
initSubpage();
initVpn();
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
internetSubpage.deviceState = { internetSubpage.deviceState = {
type: mojom.NetworkType.kVPN, type: mojom.NetworkType.kVPN,
......
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