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
8e492fa8
Unverified
Commit
8e492fa8
authored
Mar 24, 2020
by
Jonah Williams
Committed by
GitHub
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix type error with AppDomain current directory (#53181)
parent
b5cd3ce8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+3
-1
error_handling_file_system_test.dart
...t/general.shard/base/error_handling_file_system_test.dart
+15
-7
No files found.
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
8e492fa8
...
...
@@ -587,7 +587,9 @@ class AppDomain extends Domain {
'trace'
:
'
$trace
'
,
});
}
finally
{
globals
.
fs
.
currentDirectory
=
cwd
;
// If the full directory is used instead of the path then this causes
// a TypeError with the ErrorHandlingFileSystem.
globals
.
fs
.
currentDirectory
=
cwd
.
path
;
_apps
.
remove
(
app
);
}
});
...
...
packages/flutter_tools/test/general.shard/base/error_handling_file_system_test.dart
View file @
8e492fa8
...
...
@@ -4,6 +4,7 @@
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/base/error_handling_file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:platform/platform.dart'
;
import
'package:path/path.dart'
as
path
;
// ignore: package_path_import
...
...
@@ -14,8 +15,13 @@ import '../../src/testbed.dart';
class
MockFile
extends
Mock
implements
File
{}
class
MockFileSystem
extends
Mock
implements
FileSystem
{}
class
MockPlatform
extends
Mock
implements
Platform
{}
class
MockPathContext
extends
Mock
implements
path
.
Context
{}
class
MockDirectory
extends
Mock
implements
Directory
{}
final
Platform
windowsPlatform
=
FakePlatform
(
operatingSystem:
'windows'
,
environment:
<
String
,
String
>{}
);
void
main
(
)
{
group
(
'throws ToolExit on Windows'
,
()
{
...
...
@@ -23,17 +29,11 @@ void main() {
const
int
kUserMappedSectionOpened
=
1224
;
Testbed
testbed
;
MockFileSystem
mockFileSystem
;
MockPlatform
windowsPlatform
;
ErrorHandlingFileSystem
fs
;
setUp
(()
{
mockFileSystem
=
MockFileSystem
();
fs
=
ErrorHandlingFileSystem
(
mockFileSystem
);
windowsPlatform
=
MockPlatform
();
when
(
windowsPlatform
.
isWindows
).
thenReturn
(
true
);
when
(
windowsPlatform
.
isLinux
).
thenReturn
(
false
);
when
(
windowsPlatform
.
isMacOS
).
thenReturn
(
false
);
when
(
mockFileSystem
.
path
).
thenReturn
(
MockPathContext
());
testbed
=
Testbed
(
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
windowsPlatform
,
...
...
@@ -119,6 +119,14 @@ void main() {
expect
(
identical
(
firstPath
,
fs
.
path
),
false
);
});
test
(
'Throws type error if Directory type is set to curentDirectory with LocalFileSystem'
,
()
{
final
FileSystem
fs
=
ErrorHandlingFileSystem
(
const
LocalFileSystem
());
final
MockDirectory
directory
=
MockDirectory
();
when
(
directory
.
path
).
thenReturn
(
'path'
);
expect
(()
=>
fs
.
currentDirectory
=
directory
,
throwsA
(
isA
<
TypeError
>()));
});
group
(
'toString() gives toString() of delegate'
,
()
{
test
(
'ErrorHandlingFileSystem'
,
()
{
final
MockFileSystem
mockFileSystem
=
MockFileSystem
();
...
...
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