Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

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-g stuartmorgan-g 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
Collaborator 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-g stuartmorgan-g 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
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
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