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
3bc3b323
Unverified
Commit
3bc3b323
authored
Oct 15, 2019
by
Yegor
Committed by
GitHub
Oct 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reland: fix and add painting web tests (#42689)
parent
adf9d6f7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
7 deletions
+16
-7
test.dart
dev/bots/test.dart
+0
-1
gradient_test.dart
packages/flutter/test/painting/gradient_test.dart
+2
-2
image_provider_test.dart
packages/flutter/test/painting/image_provider_test.dart
+1
-1
system_fonts_test.dart
packages/flutter/test/painting/system_fonts_test.dart
+3
-3
build_script.dart
...ages/flutter_tools/lib/src/build_runner/build_script.dart
+1
-0
plugin_event_channel_test.dart
...s/flutter_web_plugins/test/plugin_event_channel_test.dart
+4
-0
plugin_registry_test.dart
packages/flutter_web_plugins/test/plugin_registry_test.dart
+5
-0
No files found.
dev/bots/test.dart
View file @
3bc3b323
...
@@ -443,7 +443,6 @@ Future<void> _runWebTests() async {
...
@@ -443,7 +443,6 @@ Future<void> _runWebTests() async {
'test/cupertino'
,
'test/cupertino'
,
'test/examples'
,
'test/examples'
,
'test/material'
,
'test/material'
,
'test/painting'
,
'test/rendering'
,
'test/rendering'
,
'test/widgets'
,
'test/widgets'
,
];
];
...
...
packages/flutter/test/painting/gradient_test.dart
View file @
3bc3b323
...
@@ -813,13 +813,13 @@ void main() {
...
@@ -813,13 +813,13 @@ void main() {
for
(
Gradient
gradient
in
gradients45
)
{
for
(
Gradient
gradient
in
gradients45
)
{
await
runTest
(
tester
,
gradient
,
45
);
await
runTest
(
tester
,
gradient
,
45
);
}
}
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
testWidgets
(
'Gradients - 90 degrees'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Gradients - 90 degrees'
,
(
WidgetTester
tester
)
async
{
for
(
Gradient
gradient
in
gradients90
)
{
for
(
Gradient
gradient
in
gradients90
)
{
await
runTest
(
tester
,
gradient
,
90
);
await
runTest
(
tester
,
gradient
,
90
);
}
}
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
});
});
}
}
...
...
packages/flutter/test/painting/image_provider_test.dart
View file @
3bc3b323
...
@@ -181,7 +181,7 @@ void main() {
...
@@ -181,7 +181,7 @@ void main() {
.
having
((
NetworkImageLoadException
e
)
=>
e
.
statusCode
,
'statusCode'
,
errorStatusCode
)
.
having
((
NetworkImageLoadException
e
)
=>
e
.
statusCode
,
'statusCode'
,
errorStatusCode
)
.
having
((
NetworkImageLoadException
e
)
=>
e
.
uri
,
'uri'
,
Uri
.
base
.
resolve
(
requestUrl
)),
.
having
((
NetworkImageLoadException
e
)
=>
e
.
uri
,
'uri'
,
Uri
.
base
.
resolve
(
requestUrl
)),
);
);
}
);
}
,
skip:
isBrowser
);
// Browser implementation does not use HTTP client but a <img> tag.
test
(
'Disallows null urls'
,
()
{
test
(
'Disallows null urls'
,
()
{
expect
(()
{
expect
(()
{
...
...
packages/flutter/test/painting/system_fonts_test.dart
View file @
3bc3b323
...
@@ -91,7 +91,7 @@ void main() {
...
@@ -91,7 +91,7 @@ void main() {
expect
(
cache
.
isEmpty
,
isTrue
);
expect
(
cache
.
isEmpty
,
isTrue
);
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoDatePicker
));
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoDatePicker
));
expect
(
element
.
dirty
,
isTrue
);
expect
(
element
.
dirty
,
isTrue
);
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets
(
'CupertinoDatePicker reset cache upon system fonts change - date mode'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'CupertinoDatePicker reset cache upon system fonts change - date mode'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -118,7 +118,7 @@ void main() {
...
@@ -118,7 +118,7 @@ void main() {
expect
(
cache
.
isNotEmpty
,
isTrue
);
expect
(
cache
.
isNotEmpty
,
isTrue
);
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoDatePicker
));
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoDatePicker
));
expect
(
element
.
dirty
,
isTrue
);
expect
(
element
.
dirty
,
isTrue
);
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets
(
'CupertinoDatePicker reset cache upon system fonts change - time mode'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'CupertinoDatePicker reset cache upon system fonts change - time mode'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -147,7 +147,7 @@ void main() {
...
@@ -147,7 +147,7 @@ void main() {
expect
(
state
.
numberLabelBaseline
-
18.400070190429688
<
precisionErrorTolerance
,
isTrue
);
expect
(
state
.
numberLabelBaseline
-
18.400070190429688
<
precisionErrorTolerance
,
isTrue
);
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoTimerPicker
));
final
Element
element
=
tester
.
element
(
find
.
byType
(
CupertinoTimerPicker
));
expect
(
element
.
dirty
,
isTrue
);
expect
(
element
.
dirty
,
isTrue
);
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920
testWidgets
(
'RangeSlider relayout upon system fonts changes'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'RangeSlider relayout upon system fonts changes'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
packages/flutter_tools/lib/src/build_runner/build_script.dart
View file @
3bc3b323
...
@@ -277,6 +277,7 @@ Future<void> main() async {
...
@@ -277,6 +277,7 @@ Future<void> main() async {
// The following parameters are hard-coded in Flutter'
s
test
embedder
.
Since
// The following parameters are hard-coded in Flutter'
s
test
embedder
.
Since
// we don't have an embedder yet this is the lowest-most layer we can put
// we don't have an embedder yet this is the lowest-most layer we can put
// this stuff in.
// this stuff in.
ui
.
debugEmulateFlutterTesterEnvironment
=
true
;
await
ui
.
webOnlyInitializeEngine
();
await
ui
.
webOnlyInitializeEngine
();
// TODO(flutterweb): remove need for dynamic cast.
// TODO(flutterweb): remove need for dynamic cast.
(
ui
.
window
as
dynamic
).
debugOverrideDevicePixelRatio
(
3.0
);
(
ui
.
window
as
dynamic
).
debugOverrideDevicePixelRatio
(
3.0
);
...
...
packages/flutter_web_plugins/test/plugin_event_channel_test.dart
View file @
3bc3b323
...
@@ -5,12 +5,16 @@
...
@@ -5,12 +5,16 @@
@TestOn
(
'chrome'
)
// Uses web-only Flutter SDK
@TestOn
(
'chrome'
)
// Uses web-only Flutter SDK
import
'dart:async'
;
import
'dart:async'
;
import
'dart:ui'
as
ui
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_web_plugins/flutter_web_plugins.dart'
;
import
'package:flutter_web_plugins/flutter_web_plugins.dart'
;
void
main
(
)
{
void
main
(
)
{
// Disabling tester emulation because this test relies on real message channel communication.
ui
.
debugEmulateFlutterTesterEnvironment
=
false
;
// ignore: undefined_prefixed_name
group
(
'Plugin Event Channel'
,
()
{
group
(
'Plugin Event Channel'
,
()
{
setUp
(()
{
setUp
(()
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter_web_plugins/test/plugin_registry_test.dart
View file @
3bc3b323
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
@TestOn
(
'chrome'
)
// Uses web-only Flutter SDK
@TestOn
(
'chrome'
)
// Uses web-only Flutter SDK
import
'dart:ui'
as
ui
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_web_plugins/flutter_web_plugins.dart'
;
import
'package:flutter_web_plugins/flutter_web_plugins.dart'
;
...
@@ -27,6 +29,9 @@ class TestPlugin {
...
@@ -27,6 +29,9 @@ class TestPlugin {
}
}
void
main
(
)
{
void
main
(
)
{
// Disabling tester emulation because this test relies on real message channel communication.
ui
.
debugEmulateFlutterTesterEnvironment
=
false
;
// ignore: undefined_prefixed_name
group
(
'Plugin Registry'
,
()
{
group
(
'Plugin Registry'
,
()
{
setUp
(()
{
setUp
(()
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
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