Skip to content

Commit

Permalink
Diagnostics: Update network disconnected string
Browse files Browse the repository at this point in the history
- Changes message for disconnected network device to "No {network_type}
  network available".
- Changes troubeshooting link text to "Try troubleshooting steps".
- Tests for correct troubleshooting link and header.
- Updates SHA for related strings.

Strings Diagnostics app link: http://go/cros-diagnostics-strings
Screenshot: http://shortn/_2vk7PweMPx

  --gtest_filter=DiagnosticsApp*'

Bug: 1197335
Test: testing/xvfb.py out/Default/browser_tests
Change-Id: I29c24259b129107af7eac95e4d784d3f68326ed2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3219856
Commit-Queue: Ashley Prasad <ashleydp@google.com>
Auto-Submit: Ashley Prasad <ashleydp@google.com>
Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931065}
  • Loading branch information
Ashley Prasad authored and Chromium LUCI CQ committed Oct 13, 2021
1 parent c68d15b commit 7747ffd
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
9 changes: 9 additions & 0 deletions ash/webui/diagnostics_ui/resources/fake_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,15 @@ export let fakeCellularDisabledNetwork = {
macAddress: '85:C5:A6:30:3F:31',
};

/** @type {!Network} */
export let fakeCellularDisconnectedNetwork = {
state: NetworkState.kNotConnected,
type: NetworkType.kCellular,
observerGuid: 'cellularDisconnectedGuid',
name: 'cellularName',
macAddress: '85:C5:A6:30:3F:31',
};

/** @type {!Array<!KeyboardInfo>} */
export let fakeKeyboards = [
{
Expand Down
39 changes: 36 additions & 3 deletions chrome/test/data/webui/chromeos/diagnostics/network_card_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'chrome://diagnostics/network_card.js';

import {fakeCellularDisabledNetwork, fakeCellularNetwork, fakeCellularWithIpConfigNetwork, fakeConnectingEthernetNetwork, fakeDisconnectedEthernetNetwork, fakeDisconnectedWifiNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakePortalWifiNetwork, fakeWifiNetwork, fakeWifiNetworkDisabled, fakeWifiNetworkInvalidNameServers, fakeWifiNetworkNoIpAddress} from 'chrome://diagnostics/fake_data.js';
import {fakeCellularDisabledNetwork, fakeCellularDisconnectedNetwork, fakeCellularNetwork, fakeCellularWithIpConfigNetwork, fakeConnectingEthernetNetwork, fakeDisconnectedEthernetNetwork, fakeDisconnectedWifiNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakePortalWifiNetwork, fakeWifiNetwork, fakeWifiNetworkDisabled, fakeWifiNetworkInvalidNameServers, fakeWifiNetworkNoIpAddress} from 'chrome://diagnostics/fake_data.js';
import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js';
import {setNetworkHealthProviderForTesting} from 'chrome://diagnostics/mojo_interface_provider.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
Expand Down Expand Up @@ -62,6 +62,8 @@ export function networkCardTestSuite() {
'cellularWithIpConfigGuid', [fakeCellularWithIpConfigNetwork]);
provider.setFakeNetworkState(
'cellularDisabledGuid', [fakeCellularDisabledNetwork]);
provider.setFakeNetworkState(
'cellularDisconnectedGuid', [fakeCellularDisconnectedNetwork]);
// Add the network info to the DOM.
networkCardElement = /** @type {!NetworkCardElement} */ (
document.createElement('network-card'));
Expand Down Expand Up @@ -204,12 +206,19 @@ export function networkCardTestSuite() {
});

test('WifiDisconnectedShowTroubleShooting', () => {
const networkType = 'Wi-Fi';
return initializeNetworkCard('wifiDisconnectedGuid').then(() => {
dx_utils.assertElementContainsText(
networkCardElement.$$('#cardTitle'), 'Wi-Fi');
networkCardElement.$$('#cardTitle'), networkType);
assertTrue(isVisible(getTroubleConnectingElement()));
assertFalse(isVisible(getNetworkInfoElement()));
assertFalse(isVisible(getIpConfigDrawerElement()));
assertEquals(
networkCardElement.i18n('troubleshootingText', networkType),
getTroubleshootingHeader());
assertEquals(
networkCardElement.i18n('troubleConnecting'),
getTroubleshootingLinkText());
});
});

Expand Down Expand Up @@ -238,13 +247,20 @@ export function networkCardTestSuite() {
});

test('EthernetDisconnectedShowTroubleShooting', () => {
const networkType = 'Ethernet';
return initializeNetworkCard('ethernetDisconnectedGuid').then(() => {
dx_utils.assertElementContainsText(
networkCardElement.$$('#cardTitle'), 'Ethernet');
networkCardElement.$$('#cardTitle'), networkType);
assertTrue(isVisible(getNetworkIcon()));
assertTrue(isVisible(getTroubleConnectingElement()));
assertFalse(isVisible(getNetworkInfoElement()));
assertFalse(isVisible(getIpConfigDrawerElement()));
assertEquals(
networkCardElement.i18n('troubleshootingText', networkType),
getTroubleshootingHeader());
assertEquals(
networkCardElement.i18n('troubleConnecting'),
getTroubleshootingLinkText());
});
});

Expand Down Expand Up @@ -349,4 +365,21 @@ export function networkCardTestSuite() {
getTroubleshootingLinkText());
});
});

test('CardTitleCellularDisconnectedInitializedCorrectly', () => {
const networkType = 'Mobile data';
return initializeNetworkCard('cellularDisconnectedGuid').then(() => {
dx_utils.assertElementContainsText(
networkCardElement.$$('#cardTitle'), networkType);
assertTrue(isVisible(getTroubleConnectingElement()));
assertFalse(isVisible(getNetworkInfoElement()));
assertFalse(isVisible(getIpConfigDrawerElement()));
assertEquals(
networkCardElement.i18n('troubleshootingText', networkType),
getTroubleshootingHeader());
assertEquals(
networkCardElement.i18n('troubleConnecting'),
getTroubleshootingLinkText());
});
});
}
4 changes: 2 additions & 2 deletions chromeos/chromeos_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -972,10 +972,10 @@ Try tapping the mic to ask me anything.
For more accurate results, close all apps until the test is complete.
</message>
<message name="IDS_DIAGNOSTICS_TROUBLE_CONNECTING" desc="The label for the text link that leads to a help support article to learn more about connecting to Ethernet networks.">
Having trouble connecting?
Try troubleshooting steps
</message>
<message name="IDS_DIAGNOSTICS_TROUBLESHOOTING_TEXT" desc="The label for the text displayed when an internet network is not in a connected or connecting state.">
No <ph name="NETWORK_NAME">$1<ex>Ethernet</ex></ph> connection detected
No <ph name="NETWORK_NAME">$1<ex>Ethernet</ex></ph> network available
</message>
<message name="IDS_DIAGNOSTICS_SYSTEM" desc="The label for the system navigation panel item.">
System
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
297a420f01147623430cb6cadbc34fbeea42d007
74e608ec779c9ad70be25b90378cccf0e2bec397
Original file line number Diff line number Diff line change
@@ -1 +1 @@
297a420f01147623430cb6cadbc34fbeea42d007
74e608ec779c9ad70be25b90378cccf0e2bec397

0 comments on commit 7747ffd

Please sign in to comment.