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
3e41962d
Unverified
Commit
3e41962d
authored
Oct 30, 2020
by
Jonah Williams
Committed by
GitHub
Oct 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[null-safety] update tests and tool auto-detection for null safe dart (#69405)
Disable null safety auto-detection for the web
parent
25622246
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
34 additions
and
12 deletions
+34
-12
test.dart
dev/bots/test.dart
+1
-0
run_demos.dart
...egration_tests/flutter_gallery/test_driver/run_demos.dart
+1
-0
scroll_perf.dart
...ration_tests/flutter_gallery/test_driver/scroll_perf.dart
+1
-0
scroll_perf_test.dart
...n_tests/flutter_gallery/test_driver/scroll_perf_test.dart
+1
-0
scroll_perf_web.dart
...on_tests/flutter_gallery/test_driver/scroll_perf_web.dart
+1
-0
scroll_perf_web_test.dart
...sts/flutter_gallery/test_driver/scroll_perf_web_test.dart
+1
-0
transitions_perf.dart
...n_tests/flutter_gallery/test_driver/transitions_perf.dart
+1
-0
transitions_perf_e2e.dart
...sts/flutter_gallery/test_driver/transitions_perf_e2e.dart
+1
-0
transitions_perf_e2e_test.dart
...lutter_gallery/test_driver/transitions_perf_e2e_test.dart
+1
-0
transitions_perf_e2e_with_semantics.dart
...lery/test_driver/transitions_perf_e2e_with_semantics.dart
+1
-0
transitions_perf_hybrid_test.dart
...ter_gallery/test_driver/transitions_perf_hybrid_test.dart
+1
-0
transitions_perf_test.dart
...ts/flutter_gallery/test_driver/transitions_perf_test.dart
+1
-0
transitions_perf_with_semantics_test.dart
...ery/test_driver/transitions_perf_with_semantics_test.dart
+1
-0
back_button.dart
...ration_tests/flutter_gallery/test_memory/back_button.dart
+1
-0
image_cache_memory.dart
...tests/flutter_gallery/test_memory/image_cache_memory.dart
+1
-0
memory_nav.dart
...gration_tests/flutter_gallery/test_memory/memory_nav.dart
+1
-0
text_editing_integration.dart
...s/web_e2e_tests/test_driver/text_editing_integration.dart
+1
-0
text_editing_integration_test.dart
..._e2e_tests/test_driver/text_editing_integration_test.dart
+1
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+10
-5
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+5
-6
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+1
-1
No files found.
dev/bots/test.dart
View file @
3e41962d
...
@@ -912,6 +912,7 @@ Future<void> _runGalleryE2eWebTest(String buildMode, { bool canvasKit = false })
...
@@ -912,6 +912,7 @@ Future<void> _runGalleryE2eWebTest(String buildMode, { bool canvasKit = false })
'--driver=test_driver/transitions_perf_e2e_test.dart'
,
'--driver=test_driver/transitions_perf_e2e_test.dart'
,
'--target=test_driver/transitions_perf_e2e.dart'
,
'--target=test_driver/transitions_perf_e2e.dart'
,
'--browser-name=chrome'
,
'--browser-name=chrome'
,
'--no-sound-null-safety'
,
'-d'
,
'-d'
,
'web-server'
,
'web-server'
,
'--
$buildMode
'
,
'--
$buildMode
'
,
...
...
dev/integration_tests/flutter_gallery/test_driver/run_demos.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'dart:ui'
;
import
'dart:ui'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf_web.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf_web_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'dart:convert'
show
JsonEncoder
;
import
'dart:convert'
show
JsonEncoder
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:integration_test/integration_test_driver.dart'
as
driver
;
import
'package:integration_test/integration_test_driver.dart'
as
driver
;
Future
<
void
>
main
()
=>
driver
.
integrationDriver
(
Future
<
void
>
main
()
=>
driver
.
integrationDriver
(
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_with_semantics.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'transitions_perf_e2e.dart'
as
transitions_perf
;
import
'transitions_perf_e2e.dart'
as
transitions_perf
;
void
main
(
)
{
void
main
(
)
{
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_hybrid_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'transitions_perf_test.dart'
as
transitions_perf_test
;
import
'transitions_perf_test.dart'
as
transitions_perf_test
;
void
main
(
[
List
<
String
>
args
=
const
<
String
>[]])
=>
transitions_perf_test
.
main
(
void
main
(
[
List
<
String
>
args
=
const
<
String
>[]])
=>
transitions_perf_test
.
main
(
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'dart:convert'
show
JsonEncoder
,
json
;
import
'dart:convert'
show
JsonEncoder
,
json
;
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_with_semantics_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'transitions_perf_test.dart'
as
transitions_perf_test
;
import
'transitions_perf_test.dart'
as
transitions_perf_test
;
void
main
(
)
{
void
main
(
)
{
...
...
dev/integration_tests/flutter_gallery/test_memory/back_button.dart
View file @
3e41962d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// @dart = 2.9
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
...
...
dev/integration_tests/flutter_gallery/test_memory/image_cache_memory.dart
View file @
3e41962d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__image_cache_memory.dart
// See //dev/devicelab/bin/tasks/flutter_gallery__image_cache_memory.dart
// @dart = 2.9
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart
View file @
3e41962d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// @dart = 2.9
import
'dart:async'
;
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
...
dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'dart:html'
;
import
'dart:html'
;
import
'dart:js_util'
as
js_util
;
import
'dart:js_util'
as
js_util
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/gestures.dart'
;
...
...
dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart
View file @
3e41962d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// 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.9
import
'package:integration_test/integration_test_driver.dart'
as
test
;
import
'package:integration_test/integration_test_driver.dart'
as
test
;
Future
<
void
>
main
()
async
=>
test
.
integrationDriver
();
Future
<
void
>
main
()
async
=>
test
.
integrationDriver
();
packages/flutter_tools/lib/src/resident_runner.dart
View file @
3e41962d
...
@@ -97,12 +97,17 @@ class FlutterDevice {
...
@@ -97,12 +97,17 @@ class FlutterDevice {
if
(
buildInfo
.
nullSafetyMode
==
NullSafetyMode
.
unsound
)
{
if
(
buildInfo
.
nullSafetyMode
==
NullSafetyMode
.
unsound
)
{
platformDillArtifact
=
Artifact
.
webPlatformKernelDill
;
platformDillArtifact
=
Artifact
.
webPlatformKernelDill
;
extraFrontEndOptions
=
buildInfo
.
extraFrontEndOptions
;
extraFrontEndOptions
=
buildInfo
.
extraFrontEndOptions
;
}
else
{
}
else
if
(
buildInfo
.
nullSafetyMode
==
NullSafetyMode
.
sound
)
{
platformDillArtifact
=
Artifact
.
webPlatformSoundKernelDill
;
platformDillArtifact
=
Artifact
.
webPlatformSoundKernelDill
;
extraFrontEndOptions
=
<
String
>[
extraFrontEndOptions
=
buildInfo
.
extraFrontEndOptions
;
...?
buildInfo
?.
extraFrontEndOptions
,
}
else
{
if
(!(
buildInfo
?.
extraFrontEndOptions
?.
contains
(
'--sound-null-safety'
)
??
false
))
// TODO(jonahwilliams): null-safe auto detection does not currently
'--sound-null-safety'
// work on the web. Always opt out of null safety if it was not
// specifically requested.
platformDillArtifact
=
Artifact
.
webPlatformKernelDill
;
extraFrontEndOptions
=
<
String
>[
...?
buildInfo
.
extraFrontEndOptions
,
'--no-sound-null-safety'
,
];
];
}
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
3e41962d
...
@@ -585,7 +585,7 @@ abstract class FlutterCommand extends Command<void> {
...
@@ -585,7 +585,7 @@ abstract class FlutterCommand extends Command<void> {
'Flutter mobile & desktop applications will attempt to run at the null safety '
'Flutter mobile & desktop applications will attempt to run at the null safety '
'level of their entrypoint library (usually lib/main.dart). Flutter web '
'level of their entrypoint library (usually lib/main.dart). Flutter web '
'applications will default to sound null-safety, unless specifically configured.'
,
'applications will default to sound null-safety, unless specifically configured.'
,
defaultsTo:
null
,
defaultsTo:
true
,
hide:
hide
,
hide:
hide
,
);
);
argParser
.
addFlag
(
FlutterOptions
.
kNullAssertions
,
argParser
.
addFlag
(
FlutterOptions
.
kNullAssertions
,
...
@@ -783,18 +783,17 @@ abstract class FlutterCommand extends Command<void> {
...
@@ -783,18 +783,17 @@ abstract class FlutterCommand extends Command<void> {
NullSafetyMode
nullSafetyMode
=
NullSafetyMode
.
unsound
;
NullSafetyMode
nullSafetyMode
=
NullSafetyMode
.
unsound
;
if
(
argParser
.
options
.
containsKey
(
FlutterOptions
.
kNullSafety
))
{
if
(
argParser
.
options
.
containsKey
(
FlutterOptions
.
kNullSafety
))
{
final
bool
nullSafety
=
boolArg
(
FlutterOptions
.
kNullSafety
);
// Explicitly check for `true` and `false` so that `null` results in not
// Explicitly check for `true` and `false` so that `null` results in not
// passing a flag. This will use the automatically detected null-safety
// passing a flag. This will use the automatically detected null-safety
// value based on the entrypoint
// value based on the entrypoint
if
(
nullSafety
==
true
)
{
if
(!
argResults
.
wasParsed
(
FlutterOptions
.
kNullSafety
))
{
nullSafetyMode
=
NullSafetyMode
.
autodetect
;
}
else
if
(
boolArg
(
FlutterOptions
.
kNullSafety
))
{
nullSafetyMode
=
NullSafetyMode
.
sound
;
nullSafetyMode
=
NullSafetyMode
.
sound
;
extraFrontEndOptions
.
add
(
'--sound-null-safety'
);
extraFrontEndOptions
.
add
(
'--sound-null-safety'
);
}
else
if
(
nullSafety
==
false
)
{
}
else
{
nullSafetyMode
=
NullSafetyMode
.
unsound
;
nullSafetyMode
=
NullSafetyMode
.
unsound
;
extraFrontEndOptions
.
add
(
'--no-sound-null-safety'
);
extraFrontEndOptions
.
add
(
'--no-sound-null-safety'
);
}
else
if
(
extraFrontEndOptions
.
contains
(
'--enable-experiment=non-nullable'
))
{
nullSafetyMode
=
NullSafetyMode
.
autodetect
;
}
}
}
}
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
3e41962d
...
@@ -2517,7 +2517,7 @@ void main() {
...
@@ -2517,7 +2517,7 @@ void main() {
Artifacts:
()
=>
Artifacts
.
test
(),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
}
);
}
,
skip:
true
);
// TODO(jonahwilliams): null safe autodetection does not work on the web.
testUsingContext
(
'FlutterDevice passes flutter-widget-cache flag when feature is enabled'
,
()
async
{
testUsingContext
(
'FlutterDevice passes flutter-widget-cache flag when feature is enabled'
,
()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
...
...
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