diagnostics: Do not show fully charged error and test status together
Bug: 1182506 Change-Id: If90b98c91e67ddc4d310ab4ec83a2258079d8830 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2721400 Commit-Queue: Bailey Berro <baileyberro@chromium.org> Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org> Cr-Commit-Position: refs/heads/master@{#858024}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cb8dab7eed
commit
ae026deeea
chrome/test/data/webui/chromeos/diagnostics
chromeos/components/diagnostics_ui/resources
@@ -12,7 +12,7 @@ import {mojoString16ToString} from 'chrome://diagnostics/mojo_utils.js';
|
||||
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
|
||||
|
||||
import {assertEquals, assertFalse, assertTrue} from '../../chai_assert.js';
|
||||
import {flushTasks, isChildVisible} from '../../test_util.m.js';
|
||||
import {flushTasks, isChildVisible, isVisible} from '../../test_util.m.js';
|
||||
|
||||
import * as dx_utils from './diagnostics_test_utils.js';
|
||||
|
||||
@@ -78,6 +78,31 @@ export function batteryStatusCardTestSuite() {
|
||||
return routineSection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status badge.
|
||||
* @return {!TextBadgeElement}
|
||||
*/
|
||||
function getStatusBadge() {
|
||||
const routineSectionElement = getRoutineSection();
|
||||
|
||||
return /** @type {!TextBadgeElement} */ (
|
||||
routineSectionElement.$$('#testStatusBadge'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status text.
|
||||
* @return {!HTMLElement}
|
||||
*/
|
||||
function getStatusTextElement() {
|
||||
const routineSectionElement = getRoutineSection();
|
||||
|
||||
const statusText =
|
||||
/** @type {!HTMLElement} */ (
|
||||
routineSectionElement.$$('#testStatusText'));
|
||||
assertTrue(!!statusText);
|
||||
return statusText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Run Tests button from inside the routine-section.
|
||||
* @return {!CrButtonElement}
|
||||
@@ -185,6 +210,8 @@ export function batteryStatusCardTestSuite() {
|
||||
routineSectionElement.additionalMessage,
|
||||
loadTimeData.getString('batteryChargeTestFullMessage'));
|
||||
assertTrue(isRunTestsButtonDisabled());
|
||||
assertFalse(isVisible(getStatusBadge()));
|
||||
assertFalse(isVisible(getStatusTextElement()));
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -66,11 +66,11 @@
|
||||
<div class="routine-status-container">
|
||||
<text-badge id="testStatusBadge"
|
||||
badge-type="[[badgeType_]]"
|
||||
hidden="[[isStatusHidden_(executionStatus_)]]"
|
||||
hidden="[[isStatusHidden_(executionStatus_, additionalMessage)]]"
|
||||
value="[[badgeText_]]">
|
||||
</text-badge>
|
||||
<span id="testStatusText"
|
||||
hidden$="[[isStatusHidden_(executionStatus_)]]">
|
||||
hidden$="[[isStatusHidden_(executionStatus_, additionalMessage)]]">
|
||||
[[statusText_]]
|
||||
<span id="learnMoreText"
|
||||
hidden$="[[isLearnMoreHidden_(executionStatus_)]]"
|
||||
|
@@ -148,7 +148,10 @@ Polymer({
|
||||
},
|
||||
},
|
||||
|
||||
observers: ['routineStatusChanged_(executionStatus_, currentTestName_)'],
|
||||
observers: [
|
||||
'routineStatusChanged_(executionStatus_, currentTestName_,' +
|
||||
'additionalMessage)',
|
||||
],
|
||||
|
||||
/** @private */
|
||||
getResultListElem_() {
|
||||
@@ -259,7 +262,8 @@ Polymer({
|
||||
|
||||
/** @protected */
|
||||
isStatusHidden_() {
|
||||
return this.executionStatus_ === ExecutionProgress.kNotStarted;
|
||||
return this.executionStatus_ === ExecutionProgress.kNotStarted ||
|
||||
this.additionalMessage != '';
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -302,6 +306,10 @@ Polymer({
|
||||
|
||||
/** @protected */
|
||||
routineStatusChanged_() {
|
||||
if (this.additionalMessage != '') {
|
||||
this.executionStatus_ = ExecutionProgress.kNotStarted;
|
||||
}
|
||||
|
||||
switch (this.executionStatus_) {
|
||||
case ExecutionProgress.kNotStarted:
|
||||
// Do nothing since status is hidden when tests have not been started.
|
||||
|
Reference in New Issue
Block a user