Skip to content

Commit

Permalink
Revert "Shimless: set fixed size and padding for QR code"
Browse files Browse the repository at this point in the history
This reverts commit e70171c.

Reason for revert: ShimlessRMABrowserTest.All gets flaky after this
CL according to bisect.
Sample failure:
https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/23362/test-results

Original change's description:
> Shimless: set fixed size and padding for QR code
>
> The padding for QR code was part of the canvas and depended on
> the size of a square in the QR code. This CL sets a fixed padding
> of 10px outsize the canvas and removes the in-canvas padding.
>
> Before:
> https://screenshot.googleplex.com/3tsJwFThn3hxq4H
> https://screenshot.googleplex.com/9FSEiEDSTuMF6Kh
>
> After:
> https://screenshot.googleplex.com/4FTpnQfJZCHvhEq
> https://screenshot.googleplex.com/7HVUkukAL4p5eD5
>
> Bug: 1198187
> Test: local
> Change-Id: Ic456dffec37db379282cdf3505f1df848de5d706
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3812907
> Auto-Submit: Anton Swifton <swifton@google.com>
> Reviewed-by: Gavin Williams <gavinwill@chromium.org>
> Commit-Queue: Gavin Williams <gavinwill@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1032189}

Bug: 1198187, 1350862
Change-Id: I254e2b12d96e5849dad2505b58cae67d72301810
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3812332
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Lingqi Chi <lingqi@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032407}
  • Loading branch information
Clqsin45 authored and Chromium LUCI CQ committed Aug 8, 2022
1 parent 82a6471 commit 3509f37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -38,8 +38,7 @@
border: 1px solid;
border-color: var(--google-grey-200);
border-radius: 8px;
padding: 10px;
width: 180px;
width: 268px;
}

#qrCodeWrapper {
Expand Down
Expand Up @@ -17,6 +17,8 @@ import {dispatchNextButtonClick, enableNextButton} from './shimless_rma_util.js'

// The size of each tile in pixels.
const QR_CODE_TILE_SIZE = 5;
// Amount of padding around the QR code in pixels.
const QR_CODE_PADDING = 4 * QR_CODE_TILE_SIZE;
// Styling for filled tiles in the QR code.
const QR_CODE_FILL_STYLE = '#000000';

Expand Down Expand Up @@ -165,7 +167,8 @@ export class OnboardingEnterRsuWpDisableCodePage extends
if (!response || !response.qrCode) {
return;
}
this.canvasSize_ = response.qrCode.size * QR_CODE_TILE_SIZE;
this.canvasSize_ =
response.qrCode.size * QR_CODE_TILE_SIZE + 2 * QR_CODE_PADDING;
const context = this.getCanvasContext_();
context.clearRect(0, 0, this.canvasSize_, this.canvasSize_);
context.fillStyle = QR_CODE_FILL_STYLE;
Expand All @@ -174,7 +177,8 @@ export class OnboardingEnterRsuWpDisableCodePage extends
for (let y = 0; y < response.qrCode.size; y++) {
if (response.qrCode.data[index]) {
context.fillRect(
x * QR_CODE_TILE_SIZE, y * QR_CODE_TILE_SIZE, QR_CODE_TILE_SIZE,
x * QR_CODE_TILE_SIZE + QR_CODE_PADDING,
y * QR_CODE_TILE_SIZE + QR_CODE_PADDING, QR_CODE_TILE_SIZE,
QR_CODE_TILE_SIZE);
}
index++;
Expand Down

0 comments on commit 3509f37

Please sign in to comment.