Skip to content

Commit

Permalink
[109] Shimless: Remove manual WP disable QR code
Browse files Browse the repository at this point in the history
- Removing this mojo endpoint for generating QR codes for manual write
  protect disable instructions
- The QR code was never used and replaced with static text

(cherry picked from commit 7aa92e7)

Bug: b:260950299
Change-Id: Iab4c5ec94c29f050f43bf22d98ab2c9ddcaac4ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4069122
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Xiangdong Kong <xiangdongkong@google.com>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1078343}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4112580
Commit-Queue: Alex Gough <ajgo@chromium.org>
Auto-Submit: Gavin Williams <gavinwill@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5414@{#758}
Cr-Branched-From: 4417ee5-refs/heads/main@{#1070088}
  • Loading branch information
Gavin Williams authored and Chromium LUCI CQ committed Dec 15, 2022
1 parent eb4b974 commit a452bf7
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 83 deletions.
8 changes: 0 additions & 8 deletions ash/webui/shimless_rma/backend/shimless_rma_service.cc
Expand Up @@ -554,14 +554,6 @@ void ShimlessRmaService::WriteProtectManuallyDisabled(
TransitionNextStateGeneric(std::move(callback));
}

void ShimlessRmaService::GetWriteProtectManuallyDisabledInstructions(
GetWriteProtectManuallyDisabledInstructionsCallback callback) {
// TODO (crbug/1268612): Replace with manufacturer specific help site.
const std::string url = "g.co/chromebook/";
mojom::QrCodePtr qr_code = GenerateQRCode(url);
std::move(callback).Run(url, std::move(qr_code));
}

void ShimlessRmaService::GetWriteProtectDisableCompleteAction(
GetWriteProtectDisableCompleteActionCallback callback) {
if (state_proto_.state_case() != rmad::RmadState::kWpDisableComplete) {
Expand Down
2 changes: 0 additions & 2 deletions ash/webui/shimless_rma/backend/shimless_rma_service.h
Expand Up @@ -75,8 +75,6 @@ class ShimlessRmaService : public mojom::ShimlessRmaService,

void WriteProtectManuallyDisabled(
WriteProtectManuallyDisabledCallback callback) override;
void GetWriteProtectManuallyDisabledInstructions(
GetWriteProtectManuallyDisabledInstructionsCallback callback) override;

void GetWriteProtectDisableCompleteAction(
GetWriteProtectDisableCompleteActionCallback callback) override;
Expand Down
41 changes: 0 additions & 41 deletions ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc
Expand Up @@ -3735,47 +3735,6 @@ TEST_F(ShimlessRmaServiceTest, ObserveFinalizationAfterSignal) {
EXPECT_EQ(fake_observer.observations[0].error, expected_error);
}

TEST_F(ShimlessRmaServiceTest, GetWriteProtectManuallyDisabledInstructions) {
const std::vector<uint8_t> expected_qrcode_data = {
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1,
1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1,
1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1,
1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1,
1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 1, 1, 0, 1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 1, 1,
1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1,
1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1,
};

shimless_rma_provider_->GetWriteProtectManuallyDisabledInstructions(
base::BindLambdaForTesting(
[&](const std::string& url, mojom::QrCodePtr qrcode) {
EXPECT_EQ(url, "g.co/chromebook/");
EXPECT_EQ(qrcode->size, 25);
EXPECT_FALSE(qrcode.is_null());
EXPECT_EQ(qrcode->data.size(), 25UL * 25UL);
EXPECT_EQ(qrcode->data.size(), expected_qrcode_data.size());
EXPECT_EQ(qrcode->data, expected_qrcode_data);
}));
}

class FakeOsUpdateObserver : public mojom::OsUpdateObserver {
public:
struct Observation {
Expand Down
5 changes: 0 additions & 5 deletions ash/webui/shimless_rma/mojom/shimless_rma.mojom
Expand Up @@ -607,11 +607,6 @@ interface ShimlessRmaService {
// been received.
WriteProtectManuallyDisabled()
=> (StateResult state_result);
// Returns a display string and QR Code image representing the URL that takes
// users to the manufacturer specific instructions page for manually disabling
// write protect.
GetWriteProtectManuallyDisabledInstructions()
=> (string display_url, QrCode? qr_code);

///////////////////////////////////////
// Methods for kWPDisableComplete state.
Expand Down
21 changes: 0 additions & 21 deletions ash/webui/shimless_rma/resources/fake_shimless_rma_service.js
Expand Up @@ -392,24 +392,6 @@ export class FakeShimlessRmaService {
'writeProtectManuallyDisabled', State.kWaitForManualWPDisable);
}

/**
* @return {!Promise<!{displayUrl: string, qrCode: ?QrCode}>}
*/
getWriteProtectManuallyDisabledInstructions() {
return this.methods_.resolveMethod(
'getWriteProtectManuallyDisabledInstructions');
}

/**
* @param {string} displayUrl
* @param {!QrCode} qrCode
*/
setGetWriteProtectManuallyDisabledInstructionsResult(displayUrl, qrCode) {
this.methods_.setResult(
'getWriteProtectManuallyDisabledInstructions',
{displayUrl: displayUrl, qrCode: qrCode});
}

/** @return {!Promise<!{action: !WriteProtectDisableCompleteAction}>} */
getWriteProtectDisableCompleteAction() {
return this.methods_.resolveMethod('getWriteProtectDisableCompleteAction');
Expand Down Expand Up @@ -1302,9 +1284,6 @@ export class FakeShimlessRmaService {
this.methods_.register('setRsuDisableWriteProtectCode');

this.methods_.register('writeProtectManuallyDisabled');
this.methods_.register('getWriteProtectManuallyDisabledInstructions');
this.methods_.register(
'setGetWriteProtectManuallyDisabledInstructionsResult');

this.methods_.register('getWriteProtectDisableCompleteAction');
this.methods_.register('confirmManualWpDisableComplete');
Expand Down
3 changes: 0 additions & 3 deletions ash/webui/shimless_rma/resources/mojo_interface_provider.js
Expand Up @@ -65,9 +65,6 @@ function setupFakeShimlessRmaService_() {
service.setGetWriteProtectDisableCompleteAction(
WriteProtectDisableCompleteAction.kCompleteAssembleDevice);

service.setGetWriteProtectManuallyDisabledInstructionsResult(
'g.co/help', fakeRsuChallengeQrCode);

service.setGetOriginalSerialNumberResult('serial# 0001');
service.setGetRegionListResult(fakeDeviceRegions);
service.setGetOriginalRegionResult(1);
Expand Down
Expand Up @@ -43,9 +43,6 @@ export function onboardingWaitForManualWpDisablePageTest() {
* @return {!Promise}
*/
function initializeWaitForManualWpDisablePage() {
service.setGetWriteProtectManuallyDisabledInstructionsResult(
'g.co/help', fakeRsuChallengeQrCode);

assertFalse(!!component);

component = /** @type {!OnboardingWaitForManualWpDisablePage} */ (
Expand Down

0 comments on commit a452bf7

Please sign in to comment.