Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
68d8c4b3
Unverified
Commit
68d8c4b3
authored
Jan 14, 2021
by
Jonah Williams
Committed by
GitHub
Jan 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] open chrome to correct base URL (#73962)
parent
bf4a5484
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
devfs_web.dart
packages/flutter_tools/lib/src/isolated/devfs_web.dart
+2
-2
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+56
-0
No files found.
packages/flutter_tools/lib/src/isolated/devfs_web.dart
View file @
68d8c4b3
...
...
@@ -707,9 +707,9 @@ class WebDevFS implements DevFS {
webAssetServer
.
webRenderer
=
WebRendererMode
.
canvaskit
;
}
if
(
hostname
==
'any'
)
{
_baseUri
=
Uri
.
http
(
'localhost:
$selectedPort
'
,
''
);
_baseUri
=
Uri
.
http
(
'localhost:
$selectedPort
'
,
webAssetServer
.
basePath
);
}
else
{
_baseUri
=
Uri
.
http
(
'
$hostname
:
$selectedPort
'
,
''
);
_baseUri
=
Uri
.
http
(
'
$hostname
:
$selectedPort
'
,
webAssetServer
.
basePath
);
}
return
_baseUri
;
}
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
68d8c4b3
...
...
@@ -1002,6 +1002,62 @@ void main() {
);
expect
(
response
.
statusCode
,
404
);
}));
test
(
'DevFS URI includes any specified base path.'
,
()
=>
testbed
.
run
(()
async
{
final
File
outputFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
..
createSync
(
recursive:
true
);
const
String
htmlContent
=
'<html><head><base href="/foo/"></head><body id="test"></body></html>'
;
globals
.
fs
.
currentDirectory
.
childDirectory
(
'web'
)
.
childFile
(
'index.html'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
htmlContent
);
outputFile
.
parent
.
childFile
(
'a.sources'
).
writeAsStringSync
(
''
);
outputFile
.
parent
.
childFile
(
'a.json'
).
writeAsStringSync
(
'{}'
);
outputFile
.
parent
.
childFile
(
'a.map'
).
writeAsStringSync
(
'{}'
);
outputFile
.
parent
.
childFile
(
'a.metadata'
).
writeAsStringSync
(
'{}'
);
final
ResidentCompiler
residentCompiler
=
MockResidentCompiler
();
when
(
residentCompiler
.
recompile
(
any
,
any
,
outputPath:
anyNamed
(
'outputPath'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
const
CompilerOutput
(
'a'
,
0
,
<
Uri
>[]);
});
final
WebDevFS
webDevFS
=
WebDevFS
(
hostname:
'localhost'
,
port:
0
,
packagesFilePath:
'.packages'
,
urlTunneller:
null
,
useSseForDebugProxy:
true
,
useSseForDebugBackend:
true
,
nullAssertions:
true
,
nativeNullAssertions:
true
,
buildInfo:
BuildInfo
.
debug
,
enableDwds:
false
,
entrypoint:
Uri
.
base
,
testMode:
true
,
expressionCompiler:
null
,
chromiumLauncher:
null
,
nullSafetyMode:
NullSafetyMode
.
unsound
,
);
webDevFS
.
requireJS
.
createSync
(
recursive:
true
);
webDevFS
.
stackTraceMapper
.
createSync
(
recursive:
true
);
final
Uri
uri
=
await
webDevFS
.
create
();
// served on localhost
expect
(
uri
.
host
,
'localhost'
);
// Matches base URI specified in html.
expect
(
uri
.
path
,
'/foo'
);
await
webDevFS
.
destroy
();
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
}));
}
class
MockHttpServer
extends
Mock
implements
HttpServer
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment