Repository navigation
[flutter_tools] Update WebAssetServer to avoid context, fix tests - #60224
Conversation
| ReleaseAssetServer(this.entrypoint); | ||
| ReleaseAssetServer(this.entrypoint, { | ||
| @required FileSystem fileSystem, | ||
| @required String webBuilDirectory, |
There was a problem hiding this comment.
| @required String webBuilDirectory, | |
| @required String webBuildDirectory, |
| fileSystem: globals.fs, | ||
| platform: globals.platform, | ||
| flutterRoot: Cache.flutterRoot, | ||
| webBuilDirectory: getWebBuildDirectory(), |
There was a problem hiding this comment.
| webBuilDirectory: getWebBuildDirectory(), | |
| webBuildDirectory: getWebBuildDirectory(), |
| }) : _fileSystem = fileSystem, | ||
| _platform = platform, | ||
| _flutterRoot = flutterRoot, | ||
| _webBuilDirectory = webBuilDirectory, |
There was a problem hiding this comment.
| _webBuilDirectory = webBuilDirectory, | |
| _webBuildDirectory = webBuildDirectory, |
|
|
||
| final Uri entrypoint; | ||
| final String _flutterRoot; | ||
| final String _webBuilDirectory; |
There was a problem hiding this comment.
| final String _webBuilDirectory; | |
| final String _webBuildDirectory; |
| globals.fs.currentDirectory.uri, | ||
| globals.fs.directory(globals.fsUtils.homeDirPath).uri, | ||
| List<Uri> _searchPaths() => <Uri>[ | ||
| _fileSystem.directory(_webBuilDirectory).uri, |
There was a problem hiding this comment.
| _fileSystem.directory(_webBuilDirectory).uri, | |
| _fileSystem.directory(_webBuildDirectory).uri, |
| } | ||
| if (request.url.path == '') { | ||
| final File file = globals.fs.file(globals.fs.path.join(getWebBuildDirectory(), 'index.html')); | ||
| final File file = _fileSystem.file(_fileSystem.path.join(_webBuilDirectory, 'index.html')); |
There was a problem hiding this comment.
| final File file = _fileSystem.file(_fileSystem.path.join(_webBuilDirectory, 'index.html')); | |
| final File file = _fileSystem.file(_fileSystem.path.join(_webBuildDirectory, 'index.html')); |
| }, overrides: <Type, Generator>{ | ||
| FileSystem: () => fileSystem, | ||
| Platform: () => platform, | ||
| ProcessManager: () => FakeProcessManager.any(), |
There was a problem hiding this comment.
was the process manager never getting called?
There was a problem hiding this comment.
I guess not, since these are now testWithoutContext. cool.
There was a problem hiding this comment.
Negatory, but we have a rule that a context injected FIleSystem requires a context Injected ProcessManager
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM once the analyzer verifies all the spelling changes are consistent.
|
Almost! Sorry I didn't accept the suggestions, that seems to trip up the CLA bot |
Not offended at all. It's probably easier to do locally anyway. |
|
Started Google testing for this PR |
|
Google testing passed! |
…utter#60224) WebAssetServer could fail if some of the global statics it depended on were initialized in a different order. Fix this by removing globals. Delete dwds startup test that needs to spawn a real server.
Description
WebAssetServer could fail if some of the global statics it depended on were initialized in a different order. Fix this by removing globals.
Delete dwds startup test that needs to spawn a real server.