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
567a4b9c
Unverified
Commit
567a4b9c
authored
Sep 05, 2018
by
Danny Tuppeny
Committed by
GitHub
Sep 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch asset_bundle_test.dart to use memory file system (#21425)
parent
05edc00a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
asset_bundle_test.dart
packages/flutter_tools/test/asset_bundle_test.dart
+13
-12
No files found.
packages/flutter_tools/test/asset_bundle_test.dart
View file @
567a4b9c
...
...
@@ -5,9 +5,11 @@
import
'dart:convert'
;
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/asset.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'src/common.dart'
;
...
...
@@ -19,26 +21,23 @@ void main() {
});
group
(
'AssetBundle.build'
,
()
{
// These tests do not use a memory file system because we want to ensure that
// asset bundles work correctly on Windows and Posix systems.
Directory
tempDir
;
Directory
oldCurrentDir
;
FileSystem
testFileSystem
;
setUp
(()
async
{
tempDir
=
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_asset_bundle_test.'
);
oldCurrentDir
=
fs
.
currentDirectory
;
fs
.
currentDirectory
=
tempDir
;
});
tearDown
(()
{
fs
.
currentDirectory
=
oldCurrentDir
;
tryToDelete
(
tempDir
);
testFileSystem
=
new
MemoryFileSystem
(
style:
platform
.
isWindows
?
FileSystemStyle
.
windows
:
FileSystemStyle
.
posix
,
);
testFileSystem
.
currentDirectory
=
testFileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_asset_bundle_test.'
);
});
testUsingContext
(
'nonempty'
,
()
async
{
final
AssetBundle
ab
=
AssetBundleFactory
.
instance
.
createBundle
();
expect
(
await
ab
.
build
(),
0
);
expect
(
ab
.
entries
.
length
,
greaterThan
(
0
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
testFileSystem
,
});
testUsingContext
(
'empty pubspec'
,
()
async
{
...
...
@@ -54,6 +53,8 @@ void main() {
utf8
.
decode
(
await
bundle
.
entries
[
'AssetManifest.json'
].
contentsAsBytes
()),
expectedAssetManifest
,
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
testFileSystem
,
});
});
...
...
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