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({
/** @private */
isUpdatedCellularUiEnabled_: {
type: Boolean,
value: loadTimeData.getBoolean('updatedCellularActivationUi'),
value() {
return loadTimeData.getBoolean('updatedCellularActivationUi');
}
},
/** @private */
......@@ -776,6 +778,12 @@ Polymer({
* @private
*/
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 &&
!!tetherDeviceState;
},
......
......@@ -43,7 +43,11 @@ suite('InternetSubpage', function() {
internetSubpage.deviceState = mojoApi_.getDeviceStateForTest(type);
}
setup(function() {
function initSubpage(isUpdatedCellularUiEnabled) {
if (isUpdatedCellularUiEnabled !== undefined) {
loadTimeData.overrideValues(
{updatedCellularActivationUi: !!isUpdatedCellularUiEnabled});
}
PolymerTest.clearBody();
internetSubpage = document.createElement('settings-internet-subpage');
assertTrue(!!internetSubpage);
......@@ -51,7 +55,7 @@ suite('InternetSubpage', function() {
document.body.appendChild(internetSubpage);
internetSubpage.init();
return flushAsync();
});
}
teardown(function() {
internetSubpage.remove();
......@@ -61,6 +65,7 @@ suite('InternetSubpage', function() {
suite('SubPage', function() {
test('WiFi', function() {
initSubpage();
const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kWiFi, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'),
......@@ -78,6 +83,7 @@ suite('InternetSubpage', function() {
});
test('Deep link to WiFi on/off toggle', async () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kWiFi, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kWiFi, 'wifi1'),
......@@ -100,6 +106,7 @@ suite('InternetSubpage', function() {
});
test('Tether', function() {
initSubpage();
const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kTether, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'),
......@@ -121,6 +128,7 @@ suite('InternetSubpage', function() {
});
test('Deep link to tether on/off toggle w/o cellular', async () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom;
setNetworksForTest(mojom.NetworkType.kTether, [
OncMojo.getDefaultNetworkState(mojom.NetworkType.kTether, 'tether1'),
......@@ -147,6 +155,7 @@ suite('InternetSubpage', function() {
});
test('Fire show cellular setup event on add cellular clicked', () => {
initSubpage();
const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kCellular);
setNetworksForTest(mojom.NetworkType.kCellular, [
......@@ -173,6 +182,7 @@ suite('InternetSubpage', function() {
});
test('Tether plus Cellular', function() {
initSubpage(false /* isUpdatedCellularUiEnabled */);
const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether);
setNetworksForTest(mojom.NetworkType.kCellular, [
......@@ -200,6 +210,7 @@ suite('InternetSubpage', function() {
});
test('Deep link to tether on/off toggle w/ cellular', async () => {
initSubpage(false /* isUpdatedCellularUiEnabled */);
const mojom = chromeos.networkConfig.mojom;
mojoApi_.setNetworkTypeEnabledState(mojom.NetworkType.kTether);
setNetworksForTest(mojom.NetworkType.kCellular, [
......@@ -229,10 +240,10 @@ suite('InternetSubpage', function() {
});
suite('VPN', function() {
setup(function() {
function initVpn() {
addTestVpnProviders();
addTestVpnNetworks();
});
}
function addTestVpnProviders() {
const mojom = chromeos.networkConfig.mojom;
......@@ -335,6 +346,8 @@ suite('InternetSubpage', function() {
}
test('should update network state list properly', function() {
initSubpage();
initVpn();
return flushAsync().then(() => {
const allNetworkLists =
internetSubpage.shadowRoot.querySelectorAll('network-list');
......@@ -354,6 +367,8 @@ suite('InternetSubpage', function() {
test(
'should not show built-in VPN list when device is disabled',
function() {
initSubpage();
initVpn();
const mojom = chromeos.networkConfig.mojom;
internetSubpage.deviceState = {
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