Skip to content

Conversation

stuartmorgan-g
Copy link
Collaborator

Updates the unit tests to run in web mode as well as VM mode, since the package supports web. To remove the file dependency, this adds base64-encoded versions of the existing test images. The originals are left as source-of-truth, in case we want to handle this differently in the future, or to visually inspect the images.

Fixes flutter/flutter#129839

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Updates the unit tests to run in web mode as well as VM mode, since the
package supports web. To remove the file dependency, this adds
base64-encoded versions of the existing test images. The originals are
left as source-of-truth, in case we want to handle this differently in
the future, or to visually inspect the images.

Fixes flutter/flutter#129839
@stuartmorgan-g
Copy link
Collaborator Author

@ditman Since this is your idea, you can review encoded_images.dart to make sure it's correct 😉

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Jul 11, 2023
@stuartmorgan-g
Copy link
Collaborator Author

Overrides: this is flagging the removal of path from the dependencies, but that's uninteresting. (It should actually have been a dev dependency in the first place.)

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 11, 2023
@auto-submit auto-submit bot merged commit ba8974c into flutter:main Jul 11, 2023
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for getting this tested on the web!

import 'dart:convert';
import 'dart:typed_data';

// This file contains base64-ecoded versions of the images in assets/, so that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a small description of how you encoded+formatted the images so people can add more test cases if needed? Website? base64 linux command with some formatting?

Also how did you get the string cut/formatted so tidily?? :P

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a small description of how you encoded+formatted the images so people can add more test cases if needed? Website? base64 linux command with some formatting?

Sorry, I figured it was trivial to figure out (I just used a website), so I didn't think it was worth mentioning.

Also how did you get the string cut/formatted so tidily?? :P

The same way I do most tedious things involving text: vim record/playback 🙂

We could make a little utility tool to do the encoding and formatting though if it comes up again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make a little utility tool to do the encoding and formatting though if it comes up again.

I thought about this as I was writing the reverse one in JSFiddle, it'd be super quick to write in JS, and even give you the formatted output :P

Comment on lines +28 to +29
'iVBORw0KGgoAAAANSUhEUgAAA+gAAAABCAIAAADCYhNkAAAACXBIWXMAAAsTAAALEwEAmpwYAA'
'AAG0lEQVRIx+3BMQEAAAwCoNk/9KzhAeQPAABYV8RfAQE8QBqiAAAAAElFTkSuQmCC');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the images look good to me (visually), verified with this:

https://jsfiddle.net/ditman/fb8qLmku/

@ditman
Copy link
Member

ditman commented Jul 11, 2023

Too late! (x_x)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 12, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 12, 2023
flutter/packages@188a846...2508714

2023-07-12 [email protected] ADD appBarBreakpoint (flutter/packages#4434)
2023-07-12 [email protected] Roll Flutter from 65ff3cb to 3ec96a8 (5 revisions) (flutter/packages#4415)
2023-07-12 [email protected] [image_picker] Roll dependancies to avoid error (flutter/packages#4431)
2023-07-12 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.0.0 to 6.0.1 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#4422)
2023-07-12 [email protected] [file_selector] Avoids using path_provider in web example app. (flutter/packages#4445)
2023-07-12 [email protected] [rfw] Add some more documentation for RFW (flutter/packages#4349)
2023-07-12 [email protected] [ci] Enable LUCI legacy analysis (flutter/packages#4435)
2023-07-11 [email protected] [webview_flutter_wkwebview] NSError.toString (flutter/packages#4441)
2023-07-11 [email protected] [ci] Remove unused Chromium setup (flutter/packages#4437)
2023-07-11 [email protected] [flutter_plugin_tools] Reimplements the excerpt system inline in the tool, rather than relying on a separate package. (flutter/packages#4417)
2023-07-11 [email protected] [ci] Remove webview_flutter implementation opt outs for custom analysis (flutter/packages#4438)
2023-07-11 [email protected] [palette_generator] Add web support to unit tests (flutter/packages#4440)
2023-07-11 [email protected] [tool] Conditionalize color on `stdout` (flutter/packages#4436)
2023-07-11 [email protected] [go_router_builder] Cleans up builder code. (flutter/packages#4356)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 13, 2023
flutter/packages@188a846...2508714

2023-07-12 [email protected] ADD appBarBreakpoint (flutter/packages#4434)
2023-07-12 [email protected] Roll Flutter from 65ff3cb to 3ec96a8 (5 revisions) (flutter/packages#4415)
2023-07-12 [email protected] [image_picker] Roll dependancies to avoid error (flutter/packages#4431)
2023-07-12 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.0.0 to 6.0.1 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#4422)
2023-07-12 [email protected] [file_selector] Avoids using path_provider in web example app. (flutter/packages#4445)
2023-07-12 [email protected] [rfw] Add some more documentation for RFW (flutter/packages#4349)
2023-07-12 [email protected] [ci] Enable LUCI legacy analysis (flutter/packages#4435)
2023-07-11 [email protected] [webview_flutter_wkwebview] NSError.toString (flutter/packages#4441)
2023-07-11 [email protected] [ci] Remove unused Chromium setup (flutter/packages#4437)
2023-07-11 [email protected] [flutter_plugin_tools] Reimplements the excerpt system inline in the tool, rather than relying on a separate package. (flutter/packages#4417)
2023-07-11 [email protected] [ci] Remove webview_flutter implementation opt outs for custom analysis (flutter/packages#4438)
2023-07-11 [email protected] [palette_generator] Add web support to unit tests (flutter/packages#4440)
2023-07-11 [email protected] [tool] Conditionalize color on `stdout` (flutter/packages#4436)
2023-07-11 [email protected] [go_router_builder] Cleans up builder code. (flutter/packages#4356)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: palette_generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[palette_generator] Tests only run in vm

3 participants