Skip to content

Commit

Permalink
Shimless: Show a calibration complete page
Browse files Browse the repository at this point in the history
The complete page shows once all rounds of calibration are complete.

screenshot: http://screen/8RghJrDD3ZvWac6

Bug: 1198187
Test: browser_test
Change-Id: I586b0033c8ceb54bfb3a06068096548e12da0e93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3575057
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/main@{#990223}
  • Loading branch information
Gavin Williams authored and Chromium LUCI CQ committed Apr 8, 2022
1 parent e3747f2 commit b0e7b6b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
Expand Up @@ -898,8 +898,7 @@ export class FakeShimlessRmaService {
},
9000);
this.triggerCalibrationOverallObserver(
CalibrationOverallStatus.kCalibrationOverallCurrentRoundComplete,
10000);
CalibrationOverallStatus.kCalibrationOverallComplete, 10000);
}
}

Expand Down
Expand Up @@ -3,8 +3,9 @@

<base-page>
<div slot="left-pane">
<h1>[[i18n('runCalibrationTitleText')]]</h1>
<div id="calibration" class="instructions">
<h1>[[getCalibrationTitleString_(calibrationComplete_)]]</h1>
<div id="calibration" class="instructions"
hidden$="[[calibrationComplete_]]">
<span>[[calibrationStatusMessage_]]</span>
</div>
</div>
Expand All @@ -13,6 +14,9 @@ <h1>[[i18n('runCalibrationTitleText')]]</h1>
<paper-spinner-lite active hidden$="[[calibrationComplete_]]"
class="large-spinner">
</paper-spinner-lite>
<!-- TODO(gavinwill): Replace calibration complete illustration. -->
<img class="illustration" src="illustrations/downloading.svg"
hidden$="[[!calibrationComplete_]]">
</div>
</div>
</base-page>
10 changes: 10 additions & 0 deletions ash/webui/shimless_rma/resources/reimaging_calibration_run_page.js
Expand Up @@ -122,6 +122,16 @@ export class ReimagingCalibrationRunPage extends
const componentType = this.i18n(ComponentTypeToId[status.component]);
return this.i18n('runCalibrationCalibratingComponent', componentType);
}

/**
* @return {string}
* @protected
*/
getCalibrationTitleString_() {
return this.i18n(
this.calibrationComplete_ ? 'runCalibrationCompleteTitleText' :
'runCalibrationTitleText');
}
}

customElements.define(
Expand Down
2 changes: 2 additions & 0 deletions ash/webui/shimless_rma/shimless_rma.cc
Expand Up @@ -188,6 +188,8 @@ void AddShimlessRmaStrings(content::WebUIDataSource* html_source) {
IDS_SHIMLESS_RMA_FINALIZE_FAILED_RETRY_BUTTON_LABEL},
// Run calibration page
{"runCalibrationTitleText", IDS_SHIMLESS_RMA_RUN_CALIBRATION_PAGE_TITLE},
{"runCalibrationCompleteTitleText",
IDS_SHIMLESS_RMA_RUN_CALIBRATION_COMPLETE_TITLE},
{"runCalibrationCompleteText", IDS_SHIMLESS_RMA_RUN_CALIBRATION_COMPLETE},
{"runCalibrationStartingText", IDS_SHIMLESS_RMA_RUN_CALIBRATION_STARTING},
{"runCalibrationCalibratingComponent",
Expand Down
Expand Up @@ -94,6 +94,18 @@ export function reimagingCalibrationRunPageTest() {
test('NextButtonAfterCalibrationCompleteTriggersContinue', async () => {
const resolver = new PromiseResolver();
await initializeCalibrationRunPage();

const calibrationTitle = component.shadowRoot.querySelector('h1');
const progressSpinner =
component.shadowRoot.querySelector('paper-spinner-lite');
const completeIllustration = component.shadowRoot.querySelector('img');

assertEquals(
loadTimeData.getString('runCalibrationTitleText'),
calibrationTitle.textContent.trim());
assertFalse(progressSpinner.hidden);
assertTrue(completeIllustration.hidden);

let calibrationCompleteCalls = 0;
service.calibrationComplete = () => {
calibrationCompleteCalls++;
Expand All @@ -112,6 +124,11 @@ export function reimagingCalibrationRunPageTest() {

assertEquals(1, calibrationCompleteCalls);
assertDeepEquals(savedResult, expectedResult);
assertEquals(
loadTimeData.getString('runCalibrationCompleteTitleText'),
calibrationTitle.textContent.trim());
assertTrue(progressSpinner.hidden);
assertFalse(completeIllustration.hidden);
});

test(
Expand Down
3 changes: 3 additions & 0 deletions chromeos/chromeos_strings.grd
Expand Up @@ -2773,6 +2773,9 @@ Try tapping the mic to ask me anything.
<message name="IDS_SHIMLESS_RMA_RUN_CALIBRATION_PAGE_TITLE" translateable="false" desc="Title for the page shown when running component calibration steps.">
Calibrating device components
</message>
<message name="IDS_SHIMLESS_RMA_RUN_CALIBRATION_COMPLETE_TITLE" translateable="false" desc="Title for the page shown when component calibration steps are complete.">
Calibration complete
</message>
<message name="IDS_SHIMLESS_RMA_RUN_CALIBRATION_COMPLETE" translateable="false" desc="Message to display when all component calibration steps are complete.">
Completed
</message>
Expand Down

0 comments on commit b0e7b6b

Please sign in to comment.