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
669a8150
Unverified
Commit
669a8150
authored
May 20, 2021
by
Dan Field
Committed by
GitHub
May 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update rendering smoke tests to assert a frame has been scheduled (#82963)
parent
78a96b09
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
4 deletions
+17
-4
custom_coordinate_systems.dart
examples/layers/rendering/custom_coordinate_systems.dart
+1
-1
flex_layout.dart
examples/layers/rendering/flex_layout.dart
+1
-1
hello_world.dart
examples/layers/rendering/hello_world.dart
+1
-1
touch_input.dart
examples/layers/rendering/touch_input.dart
+1
-1
custom_coordinate_systems_test.dart
.../smoketests/rendering/custom_coordinate_systems_test.dart
+2
-0
flex_layout_test.dart
...es/layers/test/smoketests/rendering/flex_layout_test.dart
+2
-0
hello_world_test.dart
...es/layers/test/smoketests/rendering/hello_world_test.dart
+2
-0
spinning_square_test.dart
...ayers/test/smoketests/rendering/spinning_square_test.dart
+2
-0
touch_input_test.dart
...es/layers/test/smoketests/rendering/touch_input_test.dart
+2
-0
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+3
-0
No files found.
examples/layers/rendering/custom_coordinate_systems.dart
View file @
669a8150
...
@@ -21,5 +21,5 @@ RenderBox buildSectorExample() {
...
@@ -21,5 +21,5 @@ RenderBox buildSectorExample() {
}
}
void
main
(
)
{
void
main
(
)
{
RenderingFlutterBinding
(
root:
buildSectorExample
());
RenderingFlutterBinding
(
root:
buildSectorExample
())
.
scheduleFrame
()
;
}
}
examples/layers/rendering/flex_layout.dart
View file @
669a8150
...
@@ -86,5 +86,5 @@ void main() {
...
@@ -86,5 +86,5 @@ void main() {
child:
RenderPadding
(
child:
table
,
padding:
const
EdgeInsets
.
symmetric
(
vertical:
50.0
)),
child:
RenderPadding
(
child:
table
,
padding:
const
EdgeInsets
.
symmetric
(
vertical:
50.0
)),
);
);
RenderingFlutterBinding
(
root:
root
);
RenderingFlutterBinding
(
root:
root
)
.
scheduleFrame
()
;
}
}
examples/layers/rendering/hello_world.dart
View file @
669a8150
...
@@ -25,5 +25,5 @@ void main() {
...
@@ -25,5 +25,5 @@ void main() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
),
),
);
)
.
scheduleFrame
()
;
}
}
examples/layers/rendering/touch_input.dart
View file @
669a8150
...
@@ -132,5 +132,5 @@ void main() {
...
@@ -132,5 +132,5 @@ void main() {
..
left
=
20.0
;
..
left
=
20.0
;
// Finally, we attach the render tree we've built to the screen.
// Finally, we attach the render tree we've built to the screen.
RenderingFlutterBinding
(
root:
stack
);
RenderingFlutterBinding
(
root:
stack
)
.
scheduleFrame
()
;
}
}
examples/layers/test/smoketests/rendering/custom_coordinate_systems_test.dart
View file @
669a8150
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
@@ -12,5 +13,6 @@ void main() {
...
@@ -12,5 +13,6 @@ void main() {
test
(
'layers smoketest for rendering/custom_coordinate_systems.dart'
,
()
{
test
(
'layers smoketest for rendering/custom_coordinate_systems.dart'
,
()
{
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
demo
.
main
();
demo
.
main
();
expect
(
SchedulerBinding
.
instance
!.
hasScheduledFrame
,
true
);
});
});
}
}
examples/layers/test/smoketests/rendering/flex_layout_test.dart
View file @
669a8150
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
@@ -12,5 +13,6 @@ void main() {
...
@@ -12,5 +13,6 @@ void main() {
test
(
'layers smoketest for rendering/flex_layout.dart'
,
()
{
test
(
'layers smoketest for rendering/flex_layout.dart'
,
()
{
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
demo
.
main
();
demo
.
main
();
expect
(
SchedulerBinding
.
instance
!.
hasScheduledFrame
,
true
);
});
});
}
}
examples/layers/test/smoketests/rendering/hello_world_test.dart
View file @
669a8150
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
@@ -12,5 +13,6 @@ void main() {
...
@@ -12,5 +13,6 @@ void main() {
test
(
'layers smoketest for rendering/hello_world.dart'
,
()
{
test
(
'layers smoketest for rendering/hello_world.dart'
,
()
{
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
demo
.
main
();
demo
.
main
();
expect
(
SchedulerBinding
.
instance
!.
hasScheduledFrame
,
true
);
});
});
}
}
examples/layers/test/smoketests/rendering/spinning_square_test.dart
View file @
669a8150
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
@@ -12,5 +13,6 @@ void main() {
...
@@ -12,5 +13,6 @@ void main() {
test
(
'layers smoketest for rendering/spinning_square.dart'
,
()
{
test
(
'layers smoketest for rendering/spinning_square.dart'
,
()
{
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
demo
.
main
();
demo
.
main
();
expect
(
SchedulerBinding
.
instance
!.
hasScheduledFrame
,
true
);
});
});
}
}
examples/layers/test/smoketests/rendering/touch_input_test.dart
View file @
669a8150
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
...
@@ -12,5 +13,6 @@ void main() {
...
@@ -12,5 +13,6 @@ void main() {
test
(
'layers smoketest for rendering/touch_input.dart'
,
()
{
test
(
'layers smoketest for rendering/touch_input.dart'
,
()
{
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
throw
details
.
exception
;
};
demo
.
main
();
demo
.
main
();
expect
(
SchedulerBinding
.
instance
!.
hasScheduledFrame
,
true
);
});
});
}
}
packages/flutter/lib/src/rendering/binding.dart
View file @
669a8150
...
@@ -534,6 +534,9 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler
...
@@ -534,6 +534,9 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler
///
///
/// The `root` render box is attached directly to the [renderView] and is
/// The `root` render box is attached directly to the [renderView] and is
/// given constraints that require it to fill the window.
/// given constraints that require it to fill the window.
///
/// This binding does not automatically schedule any frames. Callers are
/// responsible for deciding when to first call [scheduleFrame].
RenderingFlutterBinding
({
RenderBox
?
root
})
{
RenderingFlutterBinding
({
RenderBox
?
root
})
{
assert
(
renderView
!=
null
);
assert
(
renderView
!=
null
);
renderView
.
child
=
root
;
renderView
.
child
=
root
;
...
...
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