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
ae9ac9f2
Unverified
Commit
ae9ac9f2
authored
Jul 02, 2020
by
Jonah Williams
Committed by
GitHub
Jul 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] support starting in canvaskit with FLUTTER_WEB_USE_SKIA=true (#60708)
parent
2f43aeaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
devfs_web.dart
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
+3
-0
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+51
-0
No files found.
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
ae9ac9f2
...
...
@@ -660,6 +660,9 @@ class WebDevFS implements DevFS {
expressionCompiler
,
testMode:
testMode
,
);
if
(
buildInfo
.
dartDefines
.
contains
(
'FLUTTER_WEB_USE_SKIA=true'
))
{
webAssetServer
.
canvasKitRendering
=
true
;
}
if
(
hostname
==
'any'
)
{
_baseUri
=
Uri
.
http
(
'localhost:
$port
'
,
''
);
}
else
{
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
ae9ac9f2
...
...
@@ -486,7 +486,9 @@ void main() {
expect
(
await
webDevFS
.
webAssetServer
.
dartSourceContents
(
'dart_sdk.js'
),
'BELLOW'
);
// Toggle CanvasKit
expect
(
webDevFS
.
webAssetServer
.
canvasKitRendering
,
false
);
webDevFS
.
webAssetServer
.
canvasKitRendering
=
true
;
expect
(
await
webDevFS
.
webAssetServer
.
dartSourceContents
(
'dart_sdk.js'
),
'OL'
);
expect
(
await
webDevFS
.
webAssetServer
.
dartSourceContents
(
'dart_sdk.js.map'
),
'CHUM'
);
...
...
@@ -650,6 +652,55 @@ void main() {
expect
(
uri
,
Uri
.
http
(
'localhost:0'
,
''
));
await
webDevFS
.
destroy
();
}));
test
(
'Can start web server with canvaskit enabled'
,
()
=>
testbed
.
run
(()
async
{
globals
.
fs
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
final
File
outputFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
..
createSync
(
recursive:
true
);
outputFile
.
parent
.
childFile
(
'a.sources'
).
writeAsStringSync
(
''
);
outputFile
.
parent
.
childFile
(
'a.json'
).
writeAsStringSync
(
'{}'
);
outputFile
.
parent
.
childFile
(
'a.map'
).
writeAsStringSync
(
'{}'
);
outputFile
.
parent
.
childFile
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
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
,
buildInfo:
const
BuildInfo
(
BuildMode
.
debug
,
''
,
treeShakeIcons:
false
,
dartDefines:
<
String
>[
'FLUTTER_WEB_USE_SKIA=true'
,
]
),
enableDwds:
false
,
entrypoint:
Uri
.
base
,
testMode:
true
,
expressionCompiler:
null
,
chromiumLauncher:
null
,
);
webDevFS
.
requireJS
.
createSync
(
recursive:
true
);
webDevFS
.
stackTraceMapper
.
createSync
(
recursive:
true
);
await
webDevFS
.
create
();
expect
(
webDevFS
.
webAssetServer
.
canvasKitRendering
,
true
);
await
webDevFS
.
destroy
();
}));
}
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