Skip to content

Commit

Permalink
Diagnostics: Make gateway test non-blocking
Browse files Browse the repository at this point in the history
- This change also moves the ARC Ping test to the Local Network
  group.

Bug: 1197335
Change-Id: Id5f58b31d5e01dc5c7cdf29cd8c036f6e6d606fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3218356
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Michael Checo <michaelcheco@google.com>
Cr-Commit-Position: refs/heads/main@{#930876}
  • Loading branch information
Michael Checo authored and Chromium LUCI CQ committed Oct 13, 2021
1 parent 66c3db3 commit a346266
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
5 changes: 2 additions & 3 deletions ash/webui/diagnostics_ui/resources/diagnostics_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function createRoutine(routine, blocking) {
export function getRoutineGroups(type, isArcEnabled) {
let localNetworkGroup = new RoutineGroup(
[
createRoutine(RoutineType.kGatewayCanBePinged, true),
createRoutine(RoutineType.kGatewayCanBePinged, false),
createRoutine(RoutineType.kLanConnectivity, true),
],
'localNetworkGroupLabel');
Expand Down Expand Up @@ -157,8 +157,7 @@ export function getRoutineGroups(type, isArcEnabled) {
// Add ARC routines to their corresponding groups.
nameResolutionGroup.addRoutine(
(createRoutine(RoutineType.kArcDnsResolution, false)));
internetConnectivityGroup.addRoutine(
(createRoutine(RoutineType.kArcPing, false)));
localNetworkGroup.addRoutine((createRoutine(RoutineType.kArcPing, false)));
internetConnectivityGroup.addRoutine(
(createRoutine(RoutineType.kArcHttp, false)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,26 @@ export function diagnosticsUtilsTestSuite() {
loadTimeData.overrideValues({enableArcNetworkDiagnostics: true});
let isArcEnabled = loadTimeData.getBoolean('enableArcNetworkDiagnostics');
let routineGroups = getRoutineGroups(NetworkType.kWiFi, isArcEnabled);
let [
localNetworkGroup,
nameResolutionGroup,
wifiGroup,
internetConnectivityGroup,
]
= routineGroups;

// All groups should be present.
assertEquals(routineGroups.length, 4);

// WiFi group should exist and all three WiFi routines should be present.
let wifiGroup = routineGroups[2];
assertEquals(wifiGroup.routines.length, 3);
assertEquals(wifiGroup.groupName, 'wifiGroupLabel');

// ARC routines should be present in their categories.
let nameResolutionGroup = routineGroups[1];
assertTrue(
nameResolutionGroup.routines.includes(RoutineType.kArcDnsResolution));

let internetConnectivityGroup = routineGroups[3];
assertTrue(
internetConnectivityGroup.routines.includes(RoutineType.kArcPing));
assertTrue(localNetworkGroup.routines.includes(RoutineType.kArcPing));
assertTrue(
internetConnectivityGroup.routines.includes(RoutineType.kArcHttp));
});
Expand All @@ -98,14 +101,12 @@ export function diagnosticsUtilsTestSuite() {
loadTimeData.overrideValues({enableArcNetworkDiagnostics: false});
let isArcEnabled = loadTimeData.getBoolean('enableArcNetworkDiagnostics');
let routineGroups = getRoutineGroups(NetworkType.kEthernet, isArcEnabled);

let nameResolutionGroup = routineGroups[1];
let [localNetworkGroup, nameResolutionGroup, internetConnectivityGroup] =
routineGroups;
assertFalse(
nameResolutionGroup.routines.includes(RoutineType.kArcDnsResolution));

let internetConnectivityGroup = routineGroups[2];
assertFalse(
internetConnectivityGroup.routines.includes(RoutineType.kArcPing));
assertFalse(localNetworkGroup.routines.includes(RoutineType.kArcPing));
assertFalse(
internetConnectivityGroup.routines.includes(RoutineType.kArcHttp));
});
Expand Down

0 comments on commit a346266

Please sign in to comment.