Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webview_flutter] Use a local web server for legacy web integration tests #5956

Merged

Conversation

stuartmorgan
Copy link
Contributor

Use a local web server for the legacy test, just as for the non-legacy version.

Also updates the repo tooling to ensure that this test file is found, so it's run regardless of whether tests are run by directory or by individual path.

Part of flutter/flutter#95420

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.

@stuartmorgan stuartmorgan changed the title Webview web legacy use local server [webview_flutter] Use a local web server for legacy web integration tests Jan 22, 2024
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.

This should be much more stable! (Small question on using the loopback instead of "any" when binding the server)

const String secondaryUrl = 'https://www.google.com/robots.txt';
const String primaryPage = 'first.txt';
const String secondaryPage = 'second.txt';
final HttpServer server = await HttpServer.bind(InternetAddress.anyIPv4, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Can this be:

Suggested change
final HttpServer server = await HttpServer.bind(InternetAddress.anyIPv4, 0);
final HttpServer server = await HttpServer.bind(InternetAddress.loopbackIPv4, 0);

So you can connect only from http://localhost:${server.port}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to work; done. The previous version was just copying from other tests (I think Ian wrote the first one.)

Copy link
Member

@ditman ditman Jan 23, 2024

Choose a reason for hiding this comment

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

I think the other version just opens a random port on the machine that could potentially be connected to from the outside world? (I don't know the security ramifications, but if I do that internally at work I get an automated email flagging it :P)

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 23, 2024
@auto-submit auto-submit bot merged commit 8fbdf65 into flutter:main Jan 23, 2024
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 24, 2024
flutter/packages@841fe90...8fbdf65

2024-01-23 stuartmorgan@google.com [webview_flutter] Use a local web server for legacy web integration tests (flutter/packages#5956)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter from 3ee8ff2 to 5b673c2 (28 revisions) (flutter/packages#5965)

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 flutter-ecosystem@google.com,rmistry@google.com 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…ests (flutter#5956)

Use a local web server for the legacy test, just as for the non-legacy version.

Also updates the repo tooling to ensure that this test file is found, so it's run regardless of whether tests are run by directory or by individual path.

Part of flutter/flutter#95420
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 p: webview_flutter platform-web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants