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
237db2bb
Unverified
Commit
237db2bb
authored
Sep 20, 2023
by
derdilla
Committed by
GitHub
Sep 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cover more tests with leak tracing (#134834)
parent
2868bc13
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
12 deletions
+17
-12
semantics_binding_test.dart
packages/flutter/test/semantics/semantics_binding_test.dart
+4
-3
semantics_elevation_test.dart
...ages/flutter/test/semantics/semantics_elevation_test.dart
+6
-5
semantics_owner_test.dart
packages/flutter/test/semantics/semantics_owner_test.dart
+2
-1
semantics_update_test.dart
packages/flutter/test/semantics/semantics_update_test.dart
+3
-2
traversal_order_test.dart
packages/flutter/test/semantics/traversal_order_test.dart
+2
-1
No files found.
packages/flutter/test/semantics/semantics_binding_test.dart
View file @
237db2bb
...
...
@@ -4,9 +4,10 @@
import
'package:flutter/semantics.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
testWidgets
(
'Listeners are called when semantics are turned on with ensureSemantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Listeners are called when semantics are turned on with ensureSemantics'
,
(
WidgetTester
tester
)
async
{
expect
(
SemanticsBinding
.
instance
.
semanticsEnabled
,
isFalse
);
final
List
<
bool
>
status
=
<
bool
>[];
...
...
@@ -43,7 +44,7 @@ void main() {
expect
(
SemanticsBinding
.
instance
.
semanticsEnabled
,
isFalse
);
},
semanticsEnabled:
false
);
testWidgets
(
'Listeners are called when semantics are turned on by platform'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Listeners are called when semantics are turned on by platform'
,
(
WidgetTester
tester
)
async
{
expect
(
SemanticsBinding
.
instance
.
semanticsEnabled
,
isFalse
);
final
List
<
bool
>
status
=
<
bool
>[];
...
...
@@ -69,7 +70,7 @@ void main() {
expect
(
SemanticsBinding
.
instance
.
semanticsEnabled
,
isFalse
);
},
semanticsEnabled:
false
);
testWidgets
(
'SemanticsBinding.ensureSemantics triggers creation of semantics owner.'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'SemanticsBinding.ensureSemantics triggers creation of semantics owner.'
,
(
WidgetTester
tester
)
async
{
expect
(
SemanticsBinding
.
instance
.
semanticsEnabled
,
isFalse
);
expect
(
tester
.
binding
.
pipelineOwner
.
semanticsOwner
,
isNull
);
...
...
packages/flutter/test/semantics/semantics_elevation_test.dart
View file @
237db2bb
...
...
@@ -5,11 +5,12 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
testWidgets
(
'SemanticsNodes overlapping in z'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'SemanticsNodes overlapping in z'
,
(
WidgetTester
tester
)
async
{
// Cards are semantic boundaries that always own their own SemanticNode,
// PhysicalModels merge their semantics information into parent.
//
...
...
@@ -97,7 +98,7 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'SemanticsNodes overlapping in z with switched children'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'SemanticsNodes overlapping in z with switched children'
,
(
WidgetTester
tester
)
async
{
// Same as 'SemanticsNodes overlapping in z', but the order of children
// is reversed
...
...
@@ -173,7 +174,7 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'single node thickness'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'single node thickness'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
...
...
@@ -193,7 +194,7 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'force-merge'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'force-merge'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
@@ -247,7 +248,7 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'force-merge with inversed children'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'force-merge with inversed children'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/semantics/semantics_owner_test.dart
View file @
237db2bb
...
...
@@ -5,11 +5,12 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/semantics.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
testWidgets
(
'Performing SemanticsAction.showOnScreen does not crash if node no longer exist'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Performing SemanticsAction.showOnScreen does not crash if node no longer exist'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/100358.
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
packages/flutter/test/semantics/semantics_update_test.dart
View file @
237db2bb
...
...
@@ -8,11 +8,12 @@ import 'dart:ui' as ui;
import
'package:flutter/material.dart'
;
import
'package:flutter/semantics.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
SemanticsUpdateTestBinding
();
testWidgets
(
'Semantics update does not send update for merged nodes.'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Semantics update does not send update for merged nodes.'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
// Pumps a placeholder to trigger the warm up frame.
await
tester
.
pumpWidget
(
...
...
@@ -85,7 +86,7 @@ void main() {
handle
.
dispose
();
});
testWidgets
(
'Semantics update receives attributed text'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Semantics update receives attributed text'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
// Pumps a placeholder to trigger the warm up frame.
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/semantics/traversal_order_test.dart
View file @
237db2bb
...
...
@@ -4,11 +4,12 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
testWidgets
(
'Traversal order handles touching elements'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Traversal order handles touching elements'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
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