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
83980ef2
Unverified
Commit
83980ef2
authored
Mar 30, 2021
by
Jenn Magder
Committed by
GitHub
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate event_printer and test_config to null safety (#79346)
parent
b6a6ea70
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
30 deletions
+20
-30
io.dart
packages/flutter_tools/lib/src/base/io.dart
+0
-1
desktop.dart
...s/flutter_tools/lib/src/build_system/targets/desktop.dart
+6
-10
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+1
-1
event_printer.dart
packages/flutter_tools/lib/src/test/event_printer.dart
+4
-7
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+1
-1
flutter_web_goldens.dart
packages/flutter_tools/lib/src/test/flutter_web_goldens.dart
+1
-1
test_config.dart
packages/flutter_tools/lib/src/test/test_config.dart
+5
-7
watcher.dart
packages/flutter_tools/lib/src/test/watcher.dart
+1
-1
web_test_compiler.dart
packages/flutter_tools/lib/src/test/web_test_compiler.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/base/io.dart
View file @
83980ef2
...
@@ -248,7 +248,6 @@ class Stdio {
...
@@ -248,7 +248,6 @@ class Stdio {
Stream
<
List
<
int
>>
get
stdin
=>
io
.
stdin
;
Stream
<
List
<
int
>>
get
stdin
=>
io
.
stdin
;
@visibleForTesting
io
.
Stdout
get
stdout
{
io
.
Stdout
get
stdout
{
if
(
_stdout
!=
null
)
{
if
(
_stdout
!=
null
)
{
return
_stdout
!;
return
_stdout
!;
...
...
packages/flutter_tools/lib/src/build_system/targets/desktop.dart
View file @
83980ef2
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'../../base/file_system.dart'
;
import
'../../base/file_system.dart'
;
import
'../depfile.dart'
;
import
'../depfile.dart'
;
...
@@ -18,12 +14,12 @@ import '../depfile.dart';
...
@@ -18,12 +14,12 @@ import '../depfile.dart';
/// Throws an [Exception] if [artifacts] includes missing files, directories,
/// Throws an [Exception] if [artifacts] includes missing files, directories,
/// or links.
/// or links.
Depfile
unpackDesktopArtifacts
(
{
Depfile
unpackDesktopArtifacts
(
{
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
List
<
String
>
artifacts
,
required
List
<
String
>
artifacts
,
@
required
Directory
outputDirectory
,
required
Directory
outputDirectory
,
@
required
String
engineSourcePath
,
required
String
engineSourcePath
,
List
<
String
>
clientSourcePaths
,
List
<
String
>
?
clientSourcePaths
,
String
icuDataPath
,
String
?
icuDataPath
,
})
{
})
{
final
List
<
File
>
inputs
=
<
File
>[];
final
List
<
File
>
inputs
=
<
File
>[];
final
List
<
File
>
outputs
=
<
File
>[];
final
List
<
File
>
outputs
=
<
File
>[];
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
83980ef2
...
@@ -310,7 +310,7 @@ class TestCommand extends FlutterCommand {
...
@@ -310,7 +310,7 @@ class TestCommand extends FlutterCommand {
TestWatcher
watcher
;
TestWatcher
watcher
;
if
(
machine
)
{
if
(
machine
)
{
watcher
=
EventPrinter
(
parent:
collector
);
watcher
=
EventPrinter
(
parent:
collector
,
out:
globals
.
stdio
.
stdout
);
}
else
if
(
collector
!=
null
)
{
}
else
if
(
collector
!=
null
)
{
watcher
=
collector
;
watcher
=
collector
;
}
}
...
...
packages/flutter_tools/lib/src/test/event_printer.dart
View file @
83980ef2
...
@@ -2,25 +2,22 @@
...
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'../convert.dart'
;
import
'../convert.dart'
;
import
'../globals.dart'
as
globals
;
import
'test_device.dart'
;
import
'test_device.dart'
;
import
'watcher.dart'
;
import
'watcher.dart'
;
/// Prints JSON events when running a test in --machine mode.
/// Prints JSON events when running a test in --machine mode.
class
EventPrinter
extends
TestWatcher
{
class
EventPrinter
extends
TestWatcher
{
EventPrinter
({
StringSink
out
,
TestWatcher
parent
})
EventPrinter
({
required
StringSink
out
,
TestWatcher
?
parent
})
:
_out
=
out
??
globals
.
stdio
.
stdout
,
:
_out
=
out
,
_parent
=
parent
;
_parent
=
parent
;
final
StringSink
_out
;
final
StringSink
_out
;
final
TestWatcher
_parent
;
final
TestWatcher
?
_parent
;
@override
@override
void
handleStartedDevice
(
Uri
observatoryUri
)
{
void
handleStartedDevice
(
Uri
?
observatoryUri
)
{
_sendEvent
(
'test.startedProcess'
,
_sendEvent
(
'test.startedProcess'
,
<
String
,
dynamic
>{
'observatoryUri'
:
observatoryUri
?.
toString
()});
<
String
,
dynamic
>{
'observatoryUri'
:
observatoryUri
?.
toString
()});
_parent
?.
handleStartedDevice
(
observatoryUri
);
_parent
?.
handleStartedDevice
(
observatoryUri
);
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
83980ef2
...
@@ -517,7 +517,7 @@ class FlutterPlatform extends PlatformPlugin {
...
@@ -517,7 +517,7 @@ class FlutterPlatform extends PlatformPlugin {
);
);
return
generateTestBootstrap
(
return
generateTestBootstrap
(
testUrl:
testUrl
,
testUrl:
testUrl
,
testConfigFile:
findTestConfigFile
(
globals
.
fs
.
file
(
testUrl
)),
testConfigFile:
findTestConfigFile
(
globals
.
fs
.
file
(
testUrl
)
,
globals
.
logger
),
host:
host
,
host:
host
,
updateGoldens:
updateGoldens
,
updateGoldens:
updateGoldens
,
flutterTestDep:
packageConfig
[
'flutter_test'
]
!=
null
,
flutterTestDep:
packageConfig
[
'flutter_test'
]
!=
null
,
...
...
packages/flutter_tools/lib/src/test/flutter_web_goldens.dart
View file @
83980ef2
...
@@ -147,7 +147,7 @@ class TestGoldenComparatorProcess {
...
@@ -147,7 +147,7 @@ class TestGoldenComparatorProcess {
}
}
static
String
generateBootstrap
(
Uri
testUri
)
{
static
String
generateBootstrap
(
Uri
testUri
)
{
final
File
testConfigFile
=
findTestConfigFile
(
globals
.
fs
.
file
(
testUri
));
final
File
testConfigFile
=
findTestConfigFile
(
globals
.
fs
.
file
(
testUri
)
,
globals
.
logger
);
// Generate comparator process for the file.
// Generate comparator process for the file.
return
'''
return
'''
import '
dart:
convert
'; // flutter_ignore: dart_convert_import
import '
dart:
convert
'; // flutter_ignore: dart_convert_import
...
...
packages/flutter_tools/lib/src/test/test_config.dart
View file @
83980ef2
...
@@ -2,10 +2,8 @@
...
@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../
globals.dart'
as
globals
;
import
'../
base/logger.dart'
;
/// The name of the test configuration file that will be discovered by the
/// The name of the test configuration file that will be discovered by the
/// test harness if it exists in the project directory hierarchy.
/// test harness if it exists in the project directory hierarchy.
...
@@ -16,18 +14,18 @@ const String _kTestConfigFileName = 'flutter_test_config.dart';
...
@@ -16,18 +14,18 @@ const String _kTestConfigFileName = 'flutter_test_config.dart';
const
String
_kProjectRootSentinel
=
'pubspec.yaml'
;
const
String
_kProjectRootSentinel
=
'pubspec.yaml'
;
/// Find the `flutter_test_config.dart` file for a specific test file.
/// Find the `flutter_test_config.dart` file for a specific test file.
File
findTestConfigFile
(
File
testFile
)
{
File
?
findTestConfigFile
(
File
testFile
,
Logger
logger
)
{
File
testConfigFile
;
File
?
testConfigFile
;
Directory
directory
=
testFile
.
parent
;
Directory
directory
=
testFile
.
parent
;
while
(
directory
.
path
!=
directory
.
parent
.
path
)
{
while
(
directory
.
path
!=
directory
.
parent
.
path
)
{
final
File
configFile
=
directory
.
childFile
(
_kTestConfigFileName
);
final
File
configFile
=
directory
.
childFile
(
_kTestConfigFileName
);
if
(
configFile
.
existsSync
())
{
if
(
configFile
.
existsSync
())
{
globals
.
printTrace
(
'Discovered
$_kTestConfigFileName
in
${directory.path}
'
);
logger
.
printTrace
(
'Discovered
$_kTestConfigFileName
in
${directory.path}
'
);
testConfigFile
=
configFile
;
testConfigFile
=
configFile
;
break
;
break
;
}
}
if
(
directory
.
childFile
(
_kProjectRootSentinel
).
existsSync
())
{
if
(
directory
.
childFile
(
_kProjectRootSentinel
).
existsSync
())
{
globals
.
printTrace
(
'Stopping scan for
$_kTestConfigFileName
; '
logger
.
printTrace
(
'Stopping scan for
$_kTestConfigFileName
; '
'found project root at
${directory.path}
'
);
'found project root at
${directory.path}
'
);
break
;
break
;
}
}
...
...
packages/flutter_tools/lib/src/test/watcher.dart
View file @
83980ef2
...
@@ -10,7 +10,7 @@ abstract class TestWatcher {
...
@@ -10,7 +10,7 @@ abstract class TestWatcher {
///
///
/// If startPaused was true, the caller needs to resume in Observatory to
/// If startPaused was true, the caller needs to resume in Observatory to
/// start running the tests.
/// start running the tests.
void
handleStartedDevice
(
Uri
observatoryUri
)
{
}
void
handleStartedDevice
(
Uri
?
observatoryUri
)
{
}
/// Called after the tests finish but before the test device exits.
/// Called after the tests finish but before the test device exits.
///
///
...
...
packages/flutter_tools/lib/src/test/web_test_compiler.dart
View file @
83980ef2
...
@@ -83,7 +83,7 @@ class WebTestCompiler {
...
@@ -83,7 +83,7 @@ class WebTestCompiler {
..
writeAsStringSync
(
generateTestEntrypoint
(
..
writeAsStringSync
(
generateTestEntrypoint
(
relativeTestPath:
relativeTestSegments
.
join
(
'/'
),
relativeTestPath:
relativeTestSegments
.
join
(
'/'
),
absolutePath:
testFilePath
,
absolutePath:
testFilePath
,
testConfigPath:
findTestConfigFile
(
_fileSystem
.
file
(
testFilePath
))?.
path
,
testConfigPath:
findTestConfigFile
(
_fileSystem
.
file
(
testFilePath
)
,
_logger
)?.
path
,
languageVersion:
languageVersion
,
languageVersion:
languageVersion
,
));
));
generatedFiles
.
add
(
generatedFile
);
generatedFiles
.
add
(
generatedFile
);
...
...
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