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
1e2753b7
Unverified
Commit
1e2753b7
authored
Jun 22, 2021
by
Jonah Williams
Committed by
GitHub
Jun 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove all mocks from error handling io test (#84646)
parent
4d1da9af
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
148 deletions
+116
-148
error_handling_io_test.dart
...tools/test/general.shard/base/error_handling_io_test.dart
+103
-147
common.dart
packages/flutter_tools/test/src/common.dart
+13
-1
No files found.
packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart
View file @
1e2753b7
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/src/common.dart
View file @
1e2753b7
...
...
@@ -244,6 +244,8 @@ class _NoContext implements AppContext {
/// ```
class
FileExceptionHandler
{
final
Map
<
String
,
Map
<
FileSystemOp
,
FileSystemException
>>
_contextErrors
=
<
String
,
Map
<
FileSystemOp
,
FileSystemException
>>{};
final
Map
<
FileSystemOp
,
FileSystemException
>
_tempErrors
=
<
FileSystemOp
,
FileSystemException
>{};
static
final
RegExp
_tempDirectoryEnd
=
RegExp
(
'rand[0-9]+'
);
/// Add an exception that will be thrown whenever the file system attached to this
/// handler performs the [operation] on the [entity].
...
...
@@ -253,8 +255,18 @@ class FileExceptionHandler {
_contextErrors
[
path
]![
operation
]
=
exception
;
}
// Tear-off this method and pass it to the memory filesystem `opHandle` parameter.
void
addTempError
(
FileSystemOp
operation
,
FileSystemException
exception
)
{
_tempErrors
[
operation
]
=
exception
;
}
/// Tear-off this method and pass it to the memory filesystem `opHandle` parameter.
void
opHandle
(
String
path
,
FileSystemOp
operation
)
{
if
(
path
.
startsWith
(
'.tmp_'
)
||
_tempDirectoryEnd
.
firstMatch
(
path
)
!=
null
)
{
final
FileSystemException
?
exception
=
_tempErrors
[
operation
];
if
(
exception
!=
null
)
{
throw
exception
;
}
}
final
Map
<
FileSystemOp
,
FileSystemException
>?
exceptions
=
_contextErrors
[
path
];
if
(
exceptions
==
null
)
{
return
;
...
...
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